Introduction to filter expressions
Filter expressions are integrated into various parts of the BizzStream platform to provide granular control over data visibility and relationships. Here's a detailed look at where you'll encounter them and how to apply them.
Filter Expressions
Filter expressions are SQL-like conditions that are used to filter documents. In filter expressions, you can incorporate text expressions by enclosing them in double curly braces ({{ }}). For example, the following filter expression selects documents where the "price" field is greater than 0 and less than a value set in the "maximumValue" field.
price > 0 AND price < {{F["maximumValue"]}}
Where Are Filter Expressions Used?
They will be all explained further in their own individual documentation. A quick preview of what each expression is used for is described here:
| Location | Purpose | Description |
|---|---|---|
| Document definitions | Reference Filter | Defines filters for reference fields. |
| Layouts | Dataset Filter | Applies a filter to a dataset. |
| Menus | Menu Block Filter | This is a crucial point in the dataset filters in these menu blocks. Can filter a document out of a whole dataset. |
Filter Comparison Operators
| Operator | Description | Usage/Example |
|---|---|---|
= or IS |
Checks if values are equal. | {{F['price']}} IS 5 |
<> or != or IS NOT |
Checks if values are not equal. | {{F['price']}} IS NOT 5 |
> |
Checks if a value is greater than another. | {{F['price']}} > 5 |
< |
Checks if a value is less than another. | {{F['price']}} < 5 |
>= |
Checks if a value is greater than or equal to another. | {{F['price']}} >= 5 |
<= |
Checks if a value is less than or equal to another. | {{F['price']}} <= 5 |
BETWEEN |
Checks if a value falls within a given range. | {{F['price']}} BETWEEN 1 AND 10 |
IN |
Checks if a value exists within a list. | {{F['price']}} IN [5, 4, 3] |
NOT IN |
Checks if a value does not exist within a list. | {{F['price']}} NOT IN [4, 3] |
CONTAINS |
Checks if a field contains a specific substring. | CONTAINS({{F['name']}}, 'Duit 8') |
NOT CONTAINS |
Checks if a field does not contain a specific substring. | NOT CONTAINS({{F['name']}}, 'Duit 8') |
ISBLANK |
Checks if a field has no value (null, empty string, empty array, or missing). | ISBLANK(fieldName) |
NOT ISBLANK |
Checks if a field has any value. | NOT ISBLANK(fieldName) |
These operators can also be used in combination with BizzStream Expressions. The linked documentation offers essential insight into filter usage and the flexibility they support.
Chaining Operators
| Operator | Description |
|---|---|
AND |
Returns documents where all specified conditions are TRUE. |
OR |
Returns documents where at least one condition is TRUE. |
These operators allow you to chain filter comparison operators. For example:
number >= 5 AND number IS NOT 10
Logical Operators
| Operator | Description |
|---|---|
IF |
Enables a picking between two filter conditions based on a condition. |
IF({{F["price"] > 5}}, {{URLRESOLVER("filter")}}, date = {{TODAY()}})
({{F["price"] > 5}} resolves to a truthy value, then {{URLRESOLVER("filter")}} will be used, other wise the date = {{TODAY()}} filter will be used
Empty Field Operators
The ISBLANK and NOT ISBLANK operators let you filter documents based on whether a field has a value or not. They do not require a comparison value.
| Operator | Returns documents where… |
|---|---|
ISBLANK |
The field is null, "" (empty string), [] (empty array), or missing. |
NOT ISBLANK |
The field has any value (including 0, false, or non-empty strings). |
Syntax
ISBLANK(fieldName)
NOT ISBLANK(fieldName)
Examples
ISBLANK(email)
email field is empty, null, or missing.
NOT ISBLANK(email)
email field contains a non-empty value.
NOT ISBLANK(email) AND 'country' = "NL"
email has a value and country equals "NL".
Getting started
To start using these filters, begin by reading about the different types listed in the table above. After that, you can explore the various expression filters.