Using Filter Conditions ($filter)

Restrict the data to be retrieved using filter conditions and the filter conditions are validated before being applied.

The actions project supports Open Data Protocol (OData) query parameters, like $filter. For various purposes, query parameters are inserted into the URL. We recommend following the OData URI conventions that require the parameters to be passed correctly. The following is one of the system query options.

$filter: A filter is an object that describes a multidimensional extract of data from a data set. Query option $filter adds filtering capabilities to the OData service. So that you can filter the OData service feed or collection based on the fields available in the entity type set.

The expression language used in $filter operators supports references to properties and objects. Object values can be numbers, strings enclosed in single quotes, or boolean values.

For example, /Suppliers?$filter=City eq 'Redmond'. This retrieves all of the suppliers assigned to City, Redmond. The $filter can support additional operators such as equal, not equal, greater than, less than, etc.

Procedure
  1. Go to the Action Editor and select the $filter query parameter from your action.

  2. Navigate to the right-hand side panel and choose the Value Help.

  3. Select one of the following options:

    • Condition Editor: Choose this interface to define the group that will be applied to the input data. You can set the condition and criteria depending on your requirements. See Using the Condition Editor.

    • Text Expression: Choose this interface that enables you to use text expressions to define filters for pattern-matching against the texts and conditions being evaluated. See Using the Text Expression Editor.

  4. Choose OK.

Using the Condition Editor

Use the condition editor to set conditions.

To add an inner group condition to an existing condition, identify the existing conditions and determine which condition needs to be added. Once the condition has been determined, use the condition editor, or open up the existing group and add the inner group condition. Ensure that the condition input is syntactically correct. Once the condition is saved, test the condition to make sure that it's functioning properly and make changes as needed.

The format of valid filter conditions is as follows:
  • Single filter condition:

  • Multiple filter conditions:

Filter Parameter

Values

<filter_property_name>

Any of the properties on which the filter condition is allowed. An invalid property name is considered an invalid request.

<filter_operator>

The following binary filter operators are supported:

Operator

Description

eq

is equal

ne

isn't equal

gt

is greater than

ge

is greater than or equal

lt

is less than

le

is less than or equal

<filter_operand>

 Valid operands are strings, integer, float, true, false, null, date, datetime, and timestamp. It also supports custom parameters.

To add a condition:

  1. Choose the Value Help.

  2. Select the Condition Editor tab.

  3. Choose Add Group.

  4. Search for or select the conditions, logical operators, and criteria from the dropdown lists.

  5. Choose OK.

Using the Text Expression Editor

Use the text expression editor to set the filter conditions to retrieve the data.

Text expressions are strings of characters that consist of operators and conditions. They can be used in a variety of ways, including as input to functions, as output, or as part of a larger expression.

In a text expression, some of the valid filter conditions are formatted as follows:

Group

Operator

Details

Conditional AND

and

logical And

Conditional OR

or

logical Or

Equality

eq

equal to

ne

not equal to

Relational

gt

greater than

ge

greater than or equal to

lt

less than

le

less than or equal to

For example, the query with filter conditions looks like this:

To add a text expression:

  1. Choose the Value Help.

  2. Select the Text Expression tab.

  3. Enter conditions in the editor.

    • Example 1:

      contains(Location/Address, 'San Francisco')
    • Example 2:

      not endswith(Name,'lines')
  4. Choose OK.