In this guide:
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 do you paginate records in a table in Okta Workflows?
This guide will teach you how to paginate a table with more than 3,500 records in Okta Workflows.
Paginate a table
The TablesāSearch Rows card returns 3,500 rows (records) from a table. If a table has more than 3,500 records, you must paginate the result to retrieve all the records.
The solution has two flows:
- Main.
- Paginate table.
Table
This example uses the Countries table with 249 countries and a page size of 50.

Main flow
The Main flow starts the pagination. The flow has two inputs:
- Limit: How many records are to be returned (per page).
- Offset: at which record should the search start.

- The Call Flow card starts the pagination. It requests the first 50 records from a table.
- After paginating through all the table records, the Result field holds all the records from the table.
- The ListāLength card shows the number of records in the list (which also shows the number of records in a table).
Paginate table flow
The Paginate table flow retrieves 50 records until there are no more records in the table.

- The Helper Flow card starts this flow.
- The TablesāSearch Rows card retrieves table records using the Limit and Offset fields.
- The List-Length card calculates the list size from the previous stop.
- The BranchingāIf/Else card
- If Row count < Limit (if there are less than 50 records), these are the last records, and nothing else to retrieve after this stop.
- Else (there are more than 50 records)
- The NumberāAdd card calculates the next Offset. It adds 50 to the current Offset to show the next 50 records.
- The flow recursively calls the Call Flow card, passing the new Offset value.
- The ListāCombine All card combines the records from current and child results.
- The Flow ControlāReturn card returns all the records to the Main flow.
The following shows the recursive calls and how the calls return data.
- Execution 1 starts with Offset=0
- Execution 1 does a query, gets rows 1-50
- Execution 1 does a recursive Call Flow
- Execution 2 starts with Offset=50
- Execution 2 does a query, get rows 51-100
- Exec2 does a recursive Call Flow
- Execution 3 starts with Offset=100
- Execution 3 does a query, gets rows 101-150
- Execution 3 does a recursive Call Flow
- Execution 4 starts with Offset=150
- Execution 4 does a query, gets rows 151-200
- Execution 4 does a recursive Call Flow
- Execution 5 starts with Offset=200
- Execution 5 does a query, gets rows 201-249
- Execution 5 sees there are no more records and returns an array with rows 201-249
- Execution 4 combines its results with the child’s results
- Execution 4 returns an array with rows 151-249
- Execution 3 combines its results with the child’s results
- Execution 3 returns an array with rows 100-249
- Execution 2 combines its results with the child’s results
- Execution 2 returns an array with rows 50-249
- Execution 1 combines its results with the child’s results
- Execution 1 returns an array with rows 1-249
Template
Related Okta Workflows guides
Okta Workflows resources
šŗ Learn from Okta Workflows videos.
āAsk questions during Okta Workflows community office hours.
š Ask questions on the Okta Workflows community forum.
šš»āāļø Join the #okta-workflows channel on the MacAdmins Slack to get help from the community.
Leave a comment