How to Iterate Over Rows in an Okta Workflows Table
Last Updated:
Overview
Iterate over rows in an Okta Workflows table by finding the rows with a search and passing each row to a helper flow for processing. This configuration allows administrators to process large datasets efficiently by executing a specific set of actions on each individual record retrieved from the table.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Okta Workflows
Solution
How are rows iterated over in an Okta Workflows table?
Iterate over rows in a table by completing the following actions.
- Find the rows using a search.
- Pass each row to a helper flow to process.
Review the following example image displaying a Workflows table populated with a list of all the countries in the world.
Configure the Main/Parent flow to find and pass the rows to a Helper flow.
Configure the main flow to search for the rows using the Tables - Search Rows card and pass them to a helper flow for processing using the List - For Each card.
- In the main flow, use the Tables – Search Rows card to find the rows.
- Note: A maximum of 3,500 rows are returned. If more than 3,500 rows are desired to be returned, see an advanced method to handle in Paginate Records in a Table in Workflows (Recursion Example)
- Pass the rows to the List – For Each card to allow a helper flow to process each record individually.
- Before adding and configuring the List - For Each card, first create the helper flow(shown below) so that the Helper inputs are available when configuring the For Each card.
Review the following example image displaying the main flow configuration with the Tables - Search Rows and List - For Each cards.
Configure the helper flow inputs within the main flow to ensure the correct data is passed for processing.
- In the List – For Each card, set the helper flow in the Helper Flow input.
- Select the value to pass to the helper flow in the Country row input. Pass the entire row or object to the helper flow.
- Pass a particular property from the object or row. For more information, review How to Setup a Workflows Helper Flow (With For-Each and Streaming Cards).
Configure the helper flow to process the records.
Configure the helper flow to process the records by adding the On Demand - Helper Flow card and using the Object - Get Multiple card to read the values.
- Add the On Demand – Helper Flow card as the first card to designate the flow as a helper flow. This card has one input, Country row, which is an object type because the entire object is passed to this flow.
- Use the Object – Get Multiple card to read values from the object passed to the flow. In this example, the Country and its Code are read. For more information, review How to Read a JSON Path With Dot-Notation in Workflows.
Review the following example image displaying the helper flow configuration with the On Demand - Helper Flow and Object - Get Multiple cards.
Review the following example image displaying the helper flow execution results.
The helper flow runs 248 times for each country in the table to retrieve the country and country code.
Here is a video of this work:
