<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Export Okta User Groups to a CSV File and Email It using Workflows
Okta Classic Engine
Okta Identity Engine
Workflows

Overview

This article explains how to export Okta user groups to a CSV file and email it via Okta Workflows.

 

Solution

The automation has two flows:

  1. List user groups: flow lists user groups, exports them into a CSV file, and emails the file.
  2. 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.


A flow to list, export as a CSV file, and email it.

 

How the flow works

  1. The flow saves the groups into a table before exporting. The Tables-Clear Table card clears the table before each run.
  2. The Okta-Read User card retrieves the user information.
  3. 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 UsernameFirst name, and Last name to the helper flow.
  4. 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.
  5. 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.
  6. The Office 365 Mail-Send Email attaches the file and emails it.

 

Save groups to table flow

The Save groups to table flow saves user groups to a table for exporting to a CSV file.


Flow to save group information into a table.

 

How the flow works

  1. 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.
  2. The Text-Concatenate card combines the First name and Last name.
  3. 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:


Table with user group membership.

 

Email with group membership attachment

The automation sends the following email:


Email with group membership.

 

Related References

 

 

Loading
Export Okta User Groups to a CSV File and Email It using Workflows