FilterDataSource
Filters and orders a data source in the current session.
For more information on the types of filter that can be used, refer to the article "DataView RowFilter Syntax".
Syntax
FilterDataSource( DataSourceName, FilterWhere, SortFieldAndOrder, ModelReference );
Parameters
Parameter Name | Type | Description | Optional? | Default Value |
---|---|---|---|---|
DataSourceName | String | The name of the data source to filter. | No | n/a |
FilterWhere | String |
The filter expression to use with the specified data source. This can include column names as well as operators. Literal strings can also be included but they must be surrounded by single quotation marks. In order to use a keyword value, the filter condition must be written within a variable and then referenced here. If you do not want the function to filter the data source, set this to an empty string. |
No | n/a |
SortFieldAndOrder | String | The name of the column that the data source should be sorted by. If you do not want the function to sort the data source, set this to an empty string. To determine the sort order, append "ASC" or "DESC" after the column name - such as "ColumnName DESC". | No | n/a |
ModelReference | String | The model reference associated with the chosen data source. If the function is called by a model, it assumes the data source exists within that model, so you do not need to specify a reference unless the data source exists in a different model on the same repository. If the function is called outside the context of a model - for example, in a web page expression or via the DATASOURCE element tag - you must specify the model containing the data source. | Yes | "" |
Output
If successful, the function will return an empty string; otherwise, it will return an error message.