Learn how data filtering works and how to use it to filter your data in the page builder and actions.
Filter parts
A filter consists of three parts: a left-hand side value, an operator or comparator, and a right-hand side value. So you will be able to compare a certain value (or values) on the left with another value (or values) on the right.
This way you can get a subset of all available records.
Left-hand side
On the left, you can select a property of the currently selected model. This can either be a property of that model or the property of a relation of that model. Based on the kind of this selected property we show several operators which are available for this kind of property. For example, when the property is of kind string
it makes sense to offer the starts_with
operator, but when the property is of kind number
it makes sense to offer an operator like is after or at
or greater then
. So each kind of property has its logical operators.
Operators
As mentioned in the section about the left-hand side, we offer a set of operators for each kind of property.
Property kind |
Operator group |
|
|
boolean_operators |
|
|
date_operators |
|
|
integer_operators |
|
|
list_operators |
|
|
string_operators |
|
Right-hand side
On the right-hand side of a filter, you can select a property/variable/value to compare the left-hand side with.
Relative date filtering
When you have selected a date or datetime on the left-hand side, we offer relative values as well. Those can be:
-
Today
-
Yesterday
-
Tomorrow
-
Day before yesterday
-
Day after tomorrow
-
Three days ago
-
This week
-
Last week
-
Next week
-
This month
-
Last month
-
Next month
-
This year
-
Last year
-
Next year
When one of those values is chosen, we will calculate the date / datetime at runtime and use it in your filter.
The presets resolving (e.g. Today or This month) in the filters is done at the DataAPI level, server side. The current behavior of this resolving process is that it will take the local server time. It does not adhere to the client timezone time from which the actual request is coming.
We the future we envision that the preset resolving includes the client's timezone from which the query is sent.
Applying multiple filters
Sometimes, or maybe often, filtering by just one property is not enough. Mostly, you will want to be able to set a more specific filter. Let's say, you want to see the tasks of one user for this week. You can’t do this with one filter, because it will give you the tasks of this week, or the tasks assigned to a particular user.
In that case, you can use another filter row. In even more complex filtering, you might even need groups with one or more filter rows each.
Multiple filter rules
As mentioned above, when you want to have a more specific filter, you can add more filter rules. Each rule will compare a property with a certain value. For example when you want to show the table with users with active accounts who created them (registered) after a certain date and time and have an admin role.
Filter groups
When multiple filter rules are still not enough, you can use filter groups. For example,
take these two filter groups: the data table will either show reminders that have been created after last month with the status of 'In progress' OR any reminder that has been created by an admin. Groups consist of one or more rules.
When using groups there is another operator which is important - the AND/OR operator. You can apply this operator between filter groups.
AND/OR operator
Then AND/OR operator can be used in between filter rules. It says to either meet the criteria in both rows or meet the criteria mentioned in one or both rows.
In this example, we set two rules for the condition step: to be able to proceed with the 'True' condition flow, users would need to have either one or a second email address.