<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
Searching a Table Using a Custom Filter in Workflows
Workflows
Okta Classic Engine
Okta Identity Engine
Overview

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

Applies To
  • Okta Workflows
Solution

Searching a table

When searching a table, the search is limited to the following conditions:
 Searching a table 

These conditions are fine when searching with numbers. These conditions do not produce the results needed when searching for text.

For example, if needing to leverage starts with text searching, a different solution is needed. One solution is to use a custom filter. Send all the table rows to a custom filter card and perform the search there. This guide will show 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) to simplify testing. Click Run and enter a text to search.
  2. The Tables - Search Rows card does not 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 the text one is searching for.
    • list – is the return value from the Filter Custom card. It is 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 one searches 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 to 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 or false.

 


How does the List – Filter Custom card work?

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

The search logic can be as complex as needed. The helper flow only needs to return a true or a false value.

For example, the current search is case-sensitive. To make it non-case-sensitive, add the Text—To Lower Case card.
 

 

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  

 

Related References

 

Loading
Searching a Table Using a Custom Filter in Workflows