
ServiceS.28798 (Freedom Financial Network) asked a question.
I’m trying all kinds of ways to get a count of how many rows I have added to a table in a Workflow, while I am building a list of all Apps for All users using a nested Workflow. It dumps all Apps into a Workflow from a Google Sheet, and then reads all users assigned to that App, and then writing all the users of that App (all Apps) to a table. I’m bumping up against the 100k row limit, and can dump the rows below 100k to a file, clear all rows, and then repeat. Getting the count of Rows in a table seems seriously elusive. I’ve tried al manner of counts being added through iteration, but with concurrency, and needing to set a row seed number that gets passed in each iteration, I cannot find a way to effectively do this.
Why isn’t there a simple function in the Table section to just return the number of Rows? Is there such a function and I am just too dense to find it? Please help!
Thanks!!

You can try this:
1) Use Tables - Search Rows to search a table without a condition. This will return all the rows.
2) Use List - Length to return how many rows are in the list
The solution Max provided will Work up to the limit of the search rows card:
> Maximum number of records to return. If a filter or limit is not applied to the table search, a maximum of 3,500 rows from the selected table will be read by the Search Rows function card.
The table itself has a maximum of 100k rows. It is possible to return a list of all rows but that would take considerably more logic than the example provided. The search Rows card has the ability to set an offset. You could potentially make a Helper flow that search a table in a loop growing by the offset value you are using while combining lists until the search rows returns no results then stops the loop. The final combined table could then have the length used against it to get the total count.
I too wish there was an option to just see the count of rows. I also wish some other API endpoints like apps/groups could simply give a user/group count as this would provide some other automation options.
Hi Tim,
For groups you could use that API call with custom API action:
GET https://{yourOktaDomain}.com/api/v1/groups/{GroupID}?expand=app,stats
It will provide how many "users/apps" are assigned to that group. You may then build appropriate Workflows fetching groups assigned to Apps and then do the math 🙂
But you are right an API endpoint like "/apps/{AppID}/expand=stats" would be more efficient !
https://support.okta.com/help/s/article/Is-there-an-API-that-returns-the-number-of-users-in-a-group?language=en_US
Good catch. I don't recall seeing expand on any of the endpoints but doing a quick review its definitely there.
Here is an example of usage: