<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 Okta Workflows

Workflows
Okta Classic Engine
Okta Identity Engine

Overview

The Okta Workflows List Filter card allows administrators to filter a list to include only items that meet a specified condition. Use the List Filter card to return specific values from a list of numbers or objects based on defined criteria.

Applies To

  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Okta Workflows

Solution

The following examples provide detailed how-to instructions for filtering lists of numbers, objects by specific string, objects by specific number, or a nest object using the List Filter card in Okta Workflows.

How to filter against a list of numbers with the List Filter card?

 

In this example, it shows how to filter a list of numbers to return only values greater than or equal to 300 by configuring the List Filter card with the appropriate operator and comparison value.

workflows_howto_filter_list_numbers

Create a number list using the List Construct card.

Add a List Filter card to return only values that meet a certain condition.

    1. NOTE: 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.
    2. Set the operator field to greater than or equal to.
    3. Set the comparison value to 300.
    4. Leave the path field empty for simple number lists.

    Review the results of the flow to verify that Okta Workflows returns only numbers greater than or equal to 300.

    workflows_howto_filter_list_numbers_test

    Example JSON used for the 3 examples that follow:

    [
      {
        "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"
        }
      }
    ]

     

     

    How to filter against a list of objects by a specific string with the List Filter card?

    In this example, it shows how to filter a list of objects by specifying the path field to indicate where to search for the condition, such as searching for a department set to Operations.

    1. Create the list of objects using the List Construct card.
    2. Add a List Filter card and specify the path field to indicate where to search for the condition.
    3. Enter department in the path field.
    4. Set the operator to equal to and the comparison value to Operations.

    Review the flow configuration for filtering the department by Operations.

    Okta Workflows List Filter card configured to filter objects by the department path equal to Operations

    Verify that the flow returns the single object where the department is set to Operations.

    Execution history showing the List Filter card returning one object with the Operations department

     

     

    How to filter against a list of objects by a numerical value with the List Filter card?

    In this example, it shows how to filter the list of objects by a numerical value by setting the path to the relevant field and configuring the operator to find values greater than or equal to a specific number.

    1. In the List - Filter card
      1. Set the path field to employees.
      2. Set the operator to greater than or equal to.
      3. Set the comparison value to 10.

    Review the flow configuration for filtering departments that have ten or more employees.

    Okta Workflows List Filter card configured to filter objects by the employees path greater than or equal to 10

    Verify that the flow returns the two objects with ten or more employees.

    Execution history showing the List Filter card returning two objects with ten or more employees

    Expand the result to view the detailed object data returned by the filter.

    Expanded execution history showing the detailed object data returned by the filter

     

     

    How to filter against a list of objects by a nested path with the List Filter card?

    In this example, it shows how to filter the list of objects using a nested path by specifying the parent and child keys separated by a period.

    1. In the List - Filter card
      1. Set the path field to location.geo.
      2. Set the operator to equal to.
      3. Set the comparison value to North America.

    Review the flow configuration for filtering objects by the nested geographic location.

    Okta Workflows List Filter card configured to filter objects by the nested location.geo path equal to North America

    Verify that the flow returns the objects matching the specified geographic location.

    Execution history showing the List Filter card returning objects matching the North America location

    Related References

    Loading
    How to Filter a List with the List Filter Card in Okta Workflows | Okta Support