---
id: "packages/active-grid/api/filter-utils"
title: "Filter utils"
description: "evaluateFilter, evaluateFilterExpression, advancedFilterFn: generated from the source of active-grid."
url: "/packages/active-grid/api/filter-utils"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:filter-utils"
---

# Filter utils

Exported by `@workspace/active-grid`. Generated from the package source; part of [the index of every export](/packages/active-grid/api).

## Functions, hooks and constants

**evaluateFilter**: `(cellValue: unknown, filter: FilterValue, presentation?: GridPresentation, dateSemantic?: GridDateSemantic) => boolean`

**evaluateFilterExpression**: `<TData>(row: TData, expression: FilterExpressionNode, getFieldValue: (row: TData, field: string) => unknown, presentation?: GridPresentation, dateSemanticOf?: (field: string) => GridDateSemantic \| undefined) => boolean`

Evaluate a filter expression tree against a row.

Recursively evaluates FilterGroup nodes using AND/OR combinators
and FilterCondition leaf nodes using the existing `evaluateFilter`.

An incomplete condition, and a group holding only incomplete conditions, is
left out of its group rather than counted as a match or a miss: AND and OR
judge the remaining children, and a group with none left matches every row.
The no-value operators (`isEmpty`, `isNotEmpty`) are complete as they stand.

**advancedFilterFn**: `(row: { getValue: (id: string) => unknown; }, columnId: string, filterValue: unknown) => boolean`

A predicate a column's `filterFn` may be set to directly.

THREE parameters, and the arity is the contract. The engine calls a
`filterFn` with a fourth argument of its own — a callback that records
filter metadata on the row — so any trailing parameter declared here is
filled by that callback rather than by a caller. Do not add a
`presentation` parameter here: it would receive that callback.

The presentation-bound form is {@link createPresentationFilterFn}.

Fields of `row`:

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `getValue` | `(id: string) => unknown` | yes |  |
