Filtering a Data Source Using an Expression
You can use the FilterDataSource function to apply a filter to a data source at any time. While this function can be used with all types of data sources, it is especially useful as the only method of filtering an in-memory data source.
Implementation:
- Open the Expression Editor where you want to add the expression.
- Enter the following:
FilterDataSource( DataSourceName, FilterWhere, SortFieldAndOrder, ModelReference );
- Replace DataSourceName with the name of the data source to use.
- Replace FilterWhere with a filter expression used to specify how the data source should be filtered.
- Replace SortFieldAndOrder with the name of the column that should be used to sort the data source.
Setting this to an empty string will leave the data source unsorted. To determine the sort order, append "ASC" or "DESC" after the column name - such as "ColumnName DESC".
- (Optional) Replace ModelReference with the reference for the model associated with the data source. This is only required if this function is called outside the context of a model, such as in a web page expression.
- Save the expression.