Okta Workflows how-to guides are questions and answers from weekly community office hours, MacAdmins Workflows Slack channel, and other places. Read all other how-to guides.
On to the question.
How to filter a list with the List Filter card?
The Okta – List Filter card allows to filter a list to include only those items that meet a specified condition.
In this example, you have a list of numbers and want to filter only the numbers bigger than 300:

- The List Card card creates a number list
- Using the List Filter card, filter or return only values that meet a certain condition. In this example, the operator field is set to greater than or equal. The comparison value is 300. You are looking for numbers bigger or equal to 300
- The path is empty in this example. You will use the path in the next example
Result running this flow returns numbers greater or equal to 300:

The next examples use this list of objects:
[
{
"name": "James",
"department": "HR",
"employees": 10,
"location": {
"geo": "North America"
}
},
{
"name": "Ali",
"department": "Operations",
"employees": 20,
"location": {
"geo": "North America"
}
},
{
"name": "Jane",
"department": "Engineering",
"employees": 20,
"location": {
"geo": "South America"
}
}
]
The List Construct card creates the list. As this list has objects, the List Filter card specifies the path field. The path field indicates where to search for the condition.
In this example, you are searching for a department set to Operations:

Running this flow returns one object where department is set to Operations:

In the next example, setting the path to employees, you are filtering by all departments that have 10 or more employees:

There are two items (objects) with 10 or more employees:

Expanding the result:

In the next example, you filter by location.geo path:

Result running this flow:

More resources to help you learn:
🗂 Join the weekly community office hours to get help
📺 Short how-to Workflows videos to help you become a better automation builder.
🍿 A collection of helpful Workflows tips.
Leave a Reply