Skip to main content
Version: v11.9.4

Using Filter Conditions on Variable


Showcases

  • Use filter conditions in Variables.
  • Alternative approach to using Filter Fields in Data Tab.
  • Use mathematical expressions and other expressions.
  • List of database match modes for filter condition.
"DATABASE_MATCH_MODES": {
"start" : "STARTING_WITH",
"end" : "ENDING_WITH",
"anywhere" : "CONTAINING",
"exact" : "EQUALS",
"notequals" : "NOT_EQUALS",
"between" : "BETWEEN",
"in" : "IN",
"lessthan" : "LESS_THAN",
"lessthanequal" : "LESS_THAN_OR_EQUALS",
"greaterthan" : "GREATER_THAN",
"greaterthanequal" : "GREATER_THAN_OR_EQUALS",
"null" : "NULL",
"isnotnull" : "IS_NOT_NULL",
"empty" : "EMPTY",
"isnotempty" : "IS_NOT_EMPTY",
"nullorempty" : "NULL_OR_EMPTY"
}

Example

Depending upon the type of the data you need to use either the match mode (left side values from the above list) or filter condition (right side values from the above list), as per the following code snippet.

/* if filter field is of type string */
inputData.<string_field_name> = {
'value':'<value>',
'matchMode': 'notequals'
}

/* if filter field is of type Integer */
inputData.<integer_field_name> = {
'value':'<value>',
'filterCondition': 'NOT_EQUALS'
}

In this example, we use the following JavaScript code to filter the records from Login CRUD Variable to fetch records with ID less than or equal to a text value.

Page.LoginDataonBeforeUpdate = function (variable, inputData) {
inputData.id = {
'value': Page.Widgets.text1.datavalue,
'filterCondition': 'LESS_THAN_OR_EQUALS',
'type': 'INTEGER'
};

See Also

How to use Live Variable APIs
How to work with Notification Actions
How to work with Navigation Actions
How to work with Variables to access Queries and Procedures
How to work with Service Variables in a Form