Previous Next JavaScript must be enabled to correctly display this content

## 18.5.8.4.2 Data Filtering

Learn about data filtering operations.

The APEX engine delegates nearly all of the data filtering operations an end-user can perform in your application to the BOSS REST endpoint for server-side execution. This includes case-insensitive tokenized row search. When the Resource Type of the BOSS REST Data Source is Business Object/View or Extraction View, then the row search is translated into an appropriate combination of case-insensitive BOSS `like` filters. In contrast, when the Resource Type is Search View, the row search is translated into appropriate BOSS keyword search for faster full-text searching.

In addition, when defining a region, you can specify an External Filter using a BOSS REST Service filter expression. This is a SQL-like predicate using the case-sensitive business object attribute names from the REST payload. For reference, the attribute names are what appears in the `Selector` field of each data profile column’s definition. The filter language supports `AND` and `OR` conjunctions, grouping using parentheses, and operations.

If a BOSS REST Data Source defines an URL Pattern parameter named `additionalExternalFilter`, then this parameter can be assigned a value at runtime to handle more dynamic filtering use cases. The value must be a syntactically legal BOSS filter predicate with a balanced set of left and right parenthesis, or an `invalid filter` error will result at runtime.

The following is example of what a filter might look like:

`(category like 'SALES%' or (purchased >= '2023-07-15' and purchased <='2023-07-31'))`

You can perform case-insensitive searches by using the tilde-modified operators like this:

- `lastName ~= 'STAR'`
- `lastName ~like '%STAR%'`

External filters do not support bind variables, but they do support APEX substitution parameters (for example, `&P3_NAME.`). Substitution parameters must be used as the right side of a filter predicate and their values will be automatically single-quoted by the APEX engine when the substituted value is replaced at runtime. For example, an external WHERE clause might look similar to this:

`lastName ~= &P3_NAME.`

This example assumes the P3_NAME page item contains the value `CHIP`, the BOSS REST service will see the external where clause of:

`lastName ~= 'CHIP'`

This also works well for numerical values since the BOSS server’s filter processing allows numerical values to also be quoted on the right-hand side of a filter expression like:

`numberOfDependents > &P3_NUM_DEPS.`

This example assumes the value of the page item is 2 will turn into:

`numberOfDependents > '2'`

Parent topic: BOSS REST Data Source Runtime Features