Searching a Table Using a Custom Filter in Okta Workflows

In this guide:

  1. Okta Workflows guides
  2. Searching a table
  3. Related Okta Workflows guides
  4. Okta Workflows resources

Okta Workflows guides

Okta Workflows guides are questions and answers from the community office hours, the #okta-workflows channel on MacAdmins Slack, and other places. Read all the other guides.

How to search a table using a custom filter in Okta Workflows?

This guide will teach you how to search a table using a custom filter in Okta Workflows.

Searching a table

When you want to search a table, you are limited using the following conditions:

Searching a table.

These conditions are fine when searching with numbers. These conditions don’t produce the results you need when searching for text.

For example, if you need to leverage starts with text searching, you need a different solution. One solution is to use a custom filter. You send all the table rows to a custom filter card and perform the search there. This guide will show you how to do that.

The table looks like this. It lists all the world’s countries:

Workflows table.

This is the main flow:

Searching a table using a custom filter.

The flow has the following steps:

  1. The Helper Flow card has one input (Input). This is to simplify testing. You can click Run, and enter a text to search.
  2. The Tables - Search Rows card doesn’t specify a search condition so it returns all the rows in a table.
  3. The List – Filter Custom card, calls a helper flow to perform a custom search.
    • Country item – is a country name from the list.
    • Search for – is a text you are searching for.
    • list – is the return value from the Filter Custom card. It’s a list holding all the countries that matched the search. Note that its value is a list of text.

This is the helper flow:

A flow to perform a custom filter (search).

The flow has the following steps:

  1. The Helper Flow card has two inputs:
    • Country item – the current country from the list.
    • Search for – the text you search for.
  2. The Text – Find card finds the first instance of a string within another string.
  3. The Branching – Assign If card:
    • Returns true if position is equal or greater than 0. This means that the Text – Find card found a match.
    • Returns false if position less than 0. This means that the Text – Find card did not find a match.
  4. The Flow Control – Return card returns either true of false.

How does the List – Filter Custom card work?

The card and its helper flow allow you to specify custom search logic. If the helper flow returns a true, the current item will be added the Filter Custom card’s output list. If the helper flow returns a false, the current item will not be added to the output list.

Card’s output field.

You can make the search logic as complex as you need. The helper flow only needs to return a true or a false value.

For example, the current search is case sensitive. You could add the Text – To Lower Case card make the search not case sensitive.

Running the flow

Running the flow with the input Be:

Running the flow.

The list output field on the List – Filter Custom card holds all the countries that matched in the search.

Showing the list field details:

The List – Filter Custom card output.

Okta Workflows resources

🍫 Get help from Workflows specialists during weekly community office hours.

πŸ“Ί Learn from Workflows videos.

πŸ›Ÿ Get help from support: discuss a Workflows topic or ask a question.

πŸ™‹πŸ»β€β™€οΈ Get help from the community: join the #okta-workflows channelon MacAdmins Slack.

Leave a comment