Okta Workflows How-To: Write output from the List Users card to a CSV file

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. 

14 December 2022 Time to read: ~

A person is typing on a laptop placed on a green round table outdoors

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 write output from the List Users card to a CSV file? 

Getting started

You run a search with Okta – List Users with Filter card (or using any other search/filter card) and would like to save the result into a CSV file. This how-to guide will show you how to do that.

The workflow has the following steps:

  1. Find users
  2. Save to table
  3. Export the table to a CSV file

This is the main flow:

Okta Workflows sequence showing three connected cards: List Users with Filter, For Each iteration, and Export to CSV. A flow to save users to a CSV file
  • Okta – List Users with Filter card finds the users to save to a CSV file
  • List – For Each card goes over each user and saves the user to a table using a helper flow (see below). The entire User record is passed to the helper flow
  • Tables – Export to CSV card saves data from a table into a CSV file. You specify the CSV file name and, optionally, specify which columns to export. In this example, the columns Name and Email are exported.

The table has two (custom) columns: Name and Email:

Sample Okta Workflows user table interface showing name and email fields for exported CSV data. Workflows table with two columns

This is the helper flow that saves each user found into a table:

Okta Workflows diagram demonstrating how to process user data and write list outputs to a table or CSV file. Save user information into a table

The flow has these steps:

  • Helper Flow card receives the User record
  • Get Multiple card retrieves First Name, Last Name, and Email fields from a user
  • Concatenate card creates a Full name from First Name and Last Name fields
  • And the last, Table – Create Row card, saves each user information into a table

Learn: How to Setup a Workflows Helper Flow (With For-Each and Streaming Cards)

When the main flow is run, the table is populated with user data:

Sample Okta Workflows user table interface showing name and email fields for exported CSV data. Table with user data

Looking at the main flow history, the Tables – Export to CSV card returns a file that you can download:

Okta Workflows diagram illustrating how to query filtered active users, iterate over the returned list, and export selected user attributes to a CSV file. Main flow history

Opening User_data.csv file in Numbers:

Apple Numbers spreadsheet snippet displaying a "User_data" table with Name and Email columns containing sample user records. Opening the CSV file in Numbers

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