How to Create a Group Membership Report and Email It Using Okta Workflows

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 create a group membership report and email it using Okta Workflows?

This guide will teach how to create a group membership report. The guide will show how to export group membership to a CSV file and email it using Okta Workflows.

Group membership report

This automation lists all members of an Okta group, saves them to a table, exports the table to a CSV file, and emails the file as an attachment. The automation has 2 flows:

  1. List group members: lists all members of a group, exports them to a CSV file, and emails the file.
  2. Save to table: saves each group member to the table as the main flow streams results.

An older version of this guide, which uses For Each instead of streaming.

Flow 1: List group members

The List group members flow lists all members of a specified Okta group, exports them to a CSV file, and sends the file via email.

Export group membership flow.
Export group membership flow.

How the flow works

  1. The Table-Clear Table card clears all rows from the table before each run, so it only contains current members.
  2. The Flow Control-Assign card stores the Group ID for the group whose members you want to export.
  3. The Okta-List Group Members card lists all group members using the streaming option, passing each member to the Save to table helper flow.
  4. The Okta-Read Group card reads the group details to retrieve the group name.
  5. The Text-Concatenate card combines the group name with _members.csv to build the CSV filename.
  6. The Table-Export to CSV card exports all rows from the table to a CSV file.
  7. The Gmail-Send Email with Attachment card sends an email with the CSV file attached.

Flow 2: Save to table

The Save to table flow saves each group member’s details as a row in the table.

Save to table flow.
Save to table flow.

How the flow works

  1. Since the main flow uses streaming, the Helper Flow sets up the Record and State fields. The Record contains each group member’s First Name, Last Name, and Email.
  2. The Table-Create Row card creates a new row in the table with the member’s First Name, Last Name, and Email.

Email with attached report

The email with the attached report looks like this:

Download the flow

Related Okta Workflows guides

Okta Workflows resources

Leave a Reply

Discover more from Max Katz

Subscribe now to keep reading and get access to the full archive.

Continue reading