<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
How to Filter a List with the List Filter Card in Workflows
Workflows
Okta Classic Engine
Okta Identity Engine
Overview

This article describes how to filter a list with the List Filter card.

Applies To
  • Okta Workflows
Solution

The Okta – List Filter card allows filtering a list to include only those items that meet a specified condition.

  1. In this example, there is a list of numbers, and it is desired to filter only the numbers bigger than 300:

workflows_howto_filter_list_numbers

  • 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 to 300. The comparison value is 300. Look for numbers bigger than or equal to 300.
  • The path is empty in this example. The path will be used in the next example.
The result of running this flow returns numbers greater than or equal to 300:

workflows_howto_filter_list_numbers_test

 

  1. 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. The List Filter card specifies the path field, as this list has objects. The path field indicates where to search for the condition.

In this example, search for a department set to Operations:

workflows_howto_filter_list_objects1

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

workflows_howto_filter_list_objects1_test2

  1. In the next example, set the path to employees, and filter by all departments that have ten or more employees:

workflows_howto_filter_list_objects2

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

workflows_howto_filter_list_objects2_test

Expanding the result:

workflows_howto_filter_list_objects2_test2

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

workflows_howto_filter_list_objects3

Result running this flow:

workflows_howto_filter_list_objects3_test


Related References

Loading
How to Filter a List with the List Filter Card in Workflows