In this guide:
Okta Workflows guides
Okta Workflows guides offer questions and answers from the Okta Workflows community office hours. They also come from the #okta-workflows channel on the Mac Admins Slack and other places. Read all the other guides.
How do you export Okta user grouops to a CSV file and email it using Okta Workflows?
This guide will teach you how to export Okta user groups to a CSV file and email it using Okta Workflows.
Export and email group membership
The automation has two flows:
- List user groups: flow lists user groups, exports them into a CSV file, and emails the file.
- Save groups to table: flow saves user groups to a table for exporting to a CSV file.
List user groups flow
The List user groups flow lists user groups, exports them to a CSV file, and emails the file.

How the flow works
- The flow saves the groups into a table before exporting. The Tables-Clear Table card clears the table before each run.
- The Okta-Read User card retrieves the user information.
- The Okta-Get User Groups card lists all the user groups. It uses the streaming option, passing each group to a helper flow. The card also passes the static values for Username, First name, and Last name to the helper flow.
- After the helper flows finishes processing (saving groups into a table), the Tables-Export to CSV card exports the table data to a CSV file.
- The CSV file is placed into a list using the List-Construct card. The Office 365 Mail connector requires the attachment to be in a list.
- The Office 365 Mail-Send Email attaches the file and emails it.
List user groups flow
The Save groups to table flow saves user groups to a table for exporting to a CSV file.

How the flow works
- Since the main flow uses streaming, the Helper Flow sets up the Record and State fields. Learn how to stream records to a helper flow.
- The Record object holds each group object passed from the main flow. In addition, the Record extracts two properties from the group JSON object: ID and Profile.Name instead of using the Object-Get or Object-Get Multiple card.
- The State object holds three static values passed from the main flow.
- The Text-Concatenate card combines the First name and Last name.
- The Tables-Create Row card creates a row in a table with the following information:
- Username
- Full name
- Group ID
- Group name
The table after running the automation:

Email with group membership attachment
The automation sends the following email:

Related Okta Workflows guides
- Create Okta Groups from a CSV File in Okta Workflows.
- Save Deactivated Users, Export as CSV, and Email in Okta Workflows.
- How to Export Group Membership to a CSV File and Email the File in Okta Workflows.
- How to Write Output From the List Users Card to a CSV File.
Okta Workflows resource
🚀 New to Okta Workflows? The How to Get Started with Okta Workflows page has straighforward steps to help you get started.
📺 Like learning from videos? Watch Okta Workflows videos.
❓Have a question? Ask during community office hours, post on the community forum, or email me.
🙋🏻♀️ Want to learn from the community? Join the #okta-workflows channel on the Mac Admins Slack.
📖 Want to learn more about Okta and automation? Take the Okta Workflows training on Okta Learning.
Leave a Reply