Several Resco tools include a functionality that allows you to define conditions that allow you to filter the records used or displayed in the app. For example:
- In Woodford, when you create a view you can restrict which records should be displayed.
- When using Rules editor in various tools, you can define a variable of the type Entity and use filter to locate the record.
These are the main functions of the filter editor:
- Define conditions, group them with logical operators AND or OR.
- Define the order of the records.
- Restrict the maximum number of records.
- Export or import filters in XML format.
Each filter starts with an entity. Without additional configuration, it returns all records of that entity. If you specify a custom sort order, it is also displayed, for example:
|contact SORT: lastname, firstname|
Click Add Condition, select one of the entity fields and a condition operator, for example:
Some operators require additional arguments, for example:
Sometimes you need to filter the records of an entity using information from another entity. Click Add Link and select a related entity. You can add conditions to this related entity, and also set sort order or restrict the maximum number of returned records.
Additionally, you can decide, how your conditions should be evaluated and grouped:
- AND operator: all grouped conditions must be met
- OR operator: at least one of the grouped conditions must be met
Define sort order and restrict count
Users usually can modify the sort order in the app, but for example in case of a view, it makes sense to define a valid default sort order. You can also define sort order for related entities that you added via Add Link.
- Click Edit Sort to open the Configure Sort Fields window.
- Choose the primary column (for example, Name) and the sort order (for example, Ascending).
- Click Add if you want to another column for sorting. Click Del to remove it.
- Click OK to save your changes.
In some cases, you don't need to find all records, only top five (ordered by a relevant criterion), or even a single one. To restrict the maximum count of records, click Edit Count, enter a value, and then click OK.
Once you're done editing, click Save or Save & Close.
If you want to reuse the filter in another location, click Export XML to download the filter in XML format (FetchXML). Change to the other location, for example to a different app project, and click Import XML to reuse the filter there.