Filters allow for more efficient sorting of data and are a great tool when it comes to displaying or retrieving concise and relevant data. The type of Filter here uses Ncalc query language much like Expressions. Currently this type of Filter is used in Workflow Filter Nodes. Some of these require configuration in App Studio, hence if you don't have access to such you may need to contact your administrator.
Generic Filter Structure
- [FieldIdentifier] Ncalc Operator 'Value'
Note: Only direct Field ID references as seen above can be used in Filter strings - Expressions are not recognised. For example '[DateField] = dateNow()' will not work.
Think of filter expressions as conditions that are either met or not. Filter building is based on the reference of a particular field or fields and how they compare to a given value will determine if the Workflow triggers. It is only in the case where the overall condition is met that the Workflow will be triggered.
Most common Ncalc operators:
- <> for Not equal to
- = for Equal to
- && for And
- || for Or
- > for Greater than
- >= for Greater than or equal to
- < for Less than
- <= for Less than or equal to
Note: If suited to the use case, you can build more complex Filters or sets of conditions to be met / not. This is done by using and / or in the strings with brackets and follows boolean logic to derive an overall value of true or false.
([FieldIdentifier1] eq 'Value' and [FieldIdentifier2] eq 'Value') || [FieldIdentifier3] ne 'Value'
In the above, the Filter conditions will be met if Field1 and Field2 equal their specified values OR if Field3 is not equal to its specified value.
The given value will vary depending on what type of Field is initially referenced, these can be number values in the more traditional sense or text ones:
- [TextFieldIdentifier] - Quote the desired text value: 'Text'
- [NumberFieldIdentifier] - Quote the desired number, without quote marks: 1
- [BitFieldFieldIdentifier] - Quote the desired Boolean value, without quote marks: true or false
- [DateFieldIdentifier] - Quote the desired date value: dateParse('2021-01-01T00:00:00Z')
- e.g. [FieldName] gt dateParse('2021-01-01T00:00:00Z')
NOTE: You can also use '' for the null case on text based values, to test whether a Field is empty or not. (See Template Visibility example below)
Form Rules, Report Base Filters & Application Exceptions - Templated Reports and URL Fields
For all of the above, OData, a different type of Filter query language is used - to read all about this and its uses on Softools please see here.
Please sign in to leave a comment.