Filter

Use the Filter step to identify a subset of data that you want to keep. The purpose of filtering is to refine the data that passes through to the next step.

When creating this step, you define the filter criteria and dependencies.

Step Inputs

In the Edit Step menu, you can add details about the step configuration as needed for your flow.

Step Detail

List

Define the collection of data you want to filter. This is typically an expression that identifies the data output of a previous step. You might use the following setup to name the step with the data output that you want to filter: 

flow.step(‘step-id-goes-here’).output

Example value:

The expression names the step with the data output you want to filter, in this case, the step is called invoice lines.

Test Expressions

Enter parameters that identify the specific data you want to filter out. The expressions must evaluate to true. All data passing through that evaluates to true is the output of the filter step.

Example value:

The expression looks for a line type of 6. The Filter step keeps all invoices where this expression evaluates to true. Address the rows of the input collection using flow.loopItem().propertyName.

Step Dependencies

If needed for your flow, you can define previous steps that your Filter step is dependent on. In this section, enter values for the dependency fields: Dependent On Step Id and Dependent On Step Result Status.

For example, you might enter step dependencies if the data you wanted to filter depended on a previous step that extracted this data from a record.

Step Status

You may see one of the following statuses after running the Filter step:

SUCCESSFUL

Occurs when the input was successfully filtered.

FAILED

Occurs when:

Step Outputs

The output of this step is the filtered dataset. This data meets the particular criteria you defined in the step. 

The output of a Filter step is an array of objects. This array can have zero, one, or many objects in it. To access the property of a specific object, you will need to include the index of the object. [0] is the first element, [1] is the second element, and so on. 

Use Cases & Examples

Use the Filter step in any scenario where you need to refine the data passing through your flow. You may need to sort data by particular characteristics to narrow down the dataset. 

For example, say you have a flow where you are working with invoice data, but you only need to see purchase order line types, line type 6. You could add a Filter step to keep only lines with lineType = 6  and then continue your flow with just this subset of data.