Comment on page
Filters are used with data sources to create a subset of data. You can set a filter directly on a data source when it's created, or apply a filter to a data source in the UI or actions. Filters are continuously evaluated, so objects can be dynamically added and removed while an app is in use.
When you add an object class as a data source to an app, you should usually add a filter. The filter determines which data should be read from the database into the data source. See server-side vs. client-side filters for more information on why filters are important on data sources.
In the function editor, when you add a multi-cardinality data source as a function parameter, you can specify that the Selection is a
Filtered selectionand add a filter. The parameter will only contain the objects that match the filter.
When you create an expression in the condition editor that uses the Exists in or Not exists in operators, you can define a filtered selection from a data source as the right operand. This is available
In general, filters can be applied both server-side and client-side.
A filter applied using the Filter property on database connected data sources in apps is a server-side filter. The filter is applied on the server, and only the objects which meet the criteria of the filter are sent to the app.
Two of the primary reasons to use filters on data sources are performance and security. Filters restrict the amount of data downloaded to the client and can restrict the data to only the objects the current user should see.
For example, say you have a database connected data source Orders, that contains all orders from the last 3 months. You then apply a filter with the expression
Order.Responsible EQUALS Current Userin a table in a view called My Orders. This filter will be applied at the moment the view has evaluated that the table should be displayed in your app, and is run in the browser.