Okta Workflows How-To: Iterate over rows in a table

About the Author

Max Katz

Staff Developer Advocate, Okta Workflows

Max Katz is a Staff Developer Advocate for Okta Workflows. Max loves the no-code automation space and creating educational content. Before Okta, Max led the North America Developer Advocacy team at IBM. Before IBM, Max led developer advocacy for a cloud-based mobile app platform, Appery, helping it grow from zero to over 400,000 developers. Max regularly writes on his http://maxkatz.net blog. 

06 December 2022 Time to read: ~

A person sits on a wooden bench surrounded by lush green plants, holding a tablet

Okta Workflows is a no-code platform for automating identity processes. 

This blog post is based on a question asked during office hours or the #okta-workflows channel in MacAdmins Slack: How to iterate over rows in a table?

Getting started

To iterate over rows in a table, you need

  1. Find the rows (usually done with a search)
  2. Pass each row to a helper flow to process

Let’s look at an example using a table with all the countries in the world:

Okta Workflows "Country table" interface displaying rows of countries alongside auto-generated row IDs, timestamps, and country codes. Country table

In the main flow, to find the rows, use the Tables – Search Rows card (max. 3,500 rows will be returned). To return all the rows, don’t enter a search expression. Then pass the rows to a List – For Each card, where a helper flow will process each record at a time.

This is the main flow:

Okta Workflows interface showing a "Tables - Search Rows" card connected to a "List - For Each" card. Search for rows

In the List – For Each card, set the helper flow (Helper Flow input).

Then set the value to pass to the helper flow (Country row input).

In this flow, you are passing the entire row or object (named item) to the helper flow.

You can also pass a particular property from the object (row). To learn how to do that, read How to Setup a Workflows Helper Flow (With For-Each and Streaming Cards).

This is the helper flow:

Okta Workflows interface showing the Helper Flow configuration cards for iterating over table rows. Helper flow to process a row from a table

A flow becomes a helper flow when the first card is On Demand – Helper Flow. This card has one input Country row. Its type is an object because you are passing the entire object (row) to this flow.

You can use the Object – Get Multiple card to read values from the object (row) passed to this flow. In this example, you are reading the Country and its Code.

Learn more about how to use the Object – Get Multiple card: How to Read a JSON Path With Dot-Notation in Workflows.

Result running the flow (helper flow shown):

Workflow automation dashboard interface displaying a main flow connected to a helper flow for looping through table rows. Getting country data

The helper flow will run 248 times for each country in the table. It will get the country and country code.

Watch the Walkthrough

See how to iterate over rows in a table in this video demonstration.

Vidyard video

Get your Workflows questions answered

Do you have a question about Okta Workflows? Not sure how to build a flow? Join the weekly community office hours to get help. 

About the Author

Max Katz

Staff Developer Advocate, Okta Workflows

Max Katz is a Staff Developer Advocate for Okta Workflows. Max loves the no-code automation space and creating educational content. Before Okta, Max led the North America Developer Advocacy team at IBM. Before IBM, Max led developer advocacy for a cloud-based mobile app platform, Appery, helping it grow from zero to over 400,000 developers. Max regularly writes on his http://maxkatz.net blog. 

Continue your Identity journey