Filter

Reference documentation for using the Filter action

Written By Support Channel

Last updated 8 months ago

Overview of the Filter action

The Filter action allows you to create a new array that only includes items from an existing array that meet specific conditions. This is useful for narrowing down data sets, removing unwanted entries, or preparing items for further processing in the workflow.

Purpose

Extract only the items from an array that match a defined condition, creating a new filtered version of the original array.

Parameters

1 Set Filter Expression

Output

Filter Item.Value - Value of the current item being filtered. (This output is only available within the Set Filter Expression field.)

Filter.Filtered List - Array containing any filtered items

Understanding the Filter action

The Filter action helps you work more efficiently with arrays by narrowing them down to just the values you need. Instead of processing every item in a large array, you can apply filters to focus only on relevant entries such as: active users, priority 1 incidents, or items created today.

When setting up an expression to filter the array you are able to get the current array item’s value to be used in comparisons for the array.

Set Filter Expression

Add a Logical Expression to use to filter the array.

Array to Filter

Add the array you want to filter.

Working with Filter action

The action creates a new array variable containing only the items that match your condition. This filtered array of items can then be used in steps like the For Each action, data updates, or reporting.

Items can be added to filter directly, or an existing array can be passed into the filter.

If no items meet the condition, an empty array is returned.

Note

The original array is unchanged.

Create and manage Filter actions

Add a Filter action

Add the action

Use the following steps to add the action to a workflow.

Configure the action

Use the following steps to configure the action.

  1. Set the Set Filter Expression field. To insert a tag representing the current item being considered for filtering, type / and select the Filter Item.Value action output.

  2. Click Add under the Array to filter section to add a new item value. This reveals the Configure Array Item popup.

  3. Add items to Configure Array Item and give it a value in the Value field. This can be a simple value such as a Number or Text string, an array of existing values, the return value of an expression, or the output from another action.

  4. Click OK in the Configure Array Item popup to complete setup of your new array value.

  5. Click back in the main view to hide the slide-over.

Delete a Filter action

Use the following steps to remove the action from your workflow:

Take care when deleting an action to also remove any logic using its outputs: workflow steps may function incorrectly or break if they attempt to evaluate an output of a deleted action.