How to Filter a List with the List Filter Card

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.

Learn: How to Create a Custom List Filter in Okta Workflows

In this example, you have a list of numbers and want to filter only the numbers bigger than 300:

Using filter with a number list
  • 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:

Returning 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:

Filtering by a department

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

Result – filtering by a department

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

Filtering by a number of employees

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

Result – filtering by a number of employees

Expanding the result:

JSON result – filtering by a number of employees

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

Filtering by location

Result running this flow:

Result – filtering by location

Learn: How to Create a Custom List Filter in Okta Workflows


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.

Published by

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.