Filters

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.

Usage

Filters are configured in the same way as conditions, and rely on the same operators, but always return a data source with 0 or more objects. Filters can be applied in the following cases:

App data sources

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.

Iterating UI components

Filters can be applied to iterating containers, Select, Multi Select, Table, List, and Chart components. In this case the filter acts as an additional filter to the one applied directly to the data source. This is referred to as UI filtering and applies only in the text of that single UI component.

You can also add conditional filters, which are enabled when a specific condition is true. These are often used to provide users with filters they can apply dynamically while they use the app.

Action nodes

In the For each action node, which loops through the objects in a data source, you can apply a filter to the data source. Only the objects that match the filter will be iterated.

In the Read objects, Update object, and Delete objects action nodes, you can specify that the Selection is a Filtered selection and add a filter. The action will then only affect the objects that match the filter.

Functions

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 selection and add a filter. The parameter will only contain the objects that match the filter.

Conditions

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

Server-side vs. client-side filters

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.

All other filters, such as those applied in the UI or in actions, are client-side filters. This includes filters added using the Client Filters property on database connected data sources.

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 User in 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.

Last updated