How to Export Group Membership to a CSV File and Email the File in Okta Workflows

  1. Okta Workflows guides
  2. Get group membership flow
  3. Helper flow and table
  4. Clearing the table
  5. Running the flow
  6. Video building the flow
  7. Related Workflows guides
  8. Workflows resources

Okta Workflows guides

Okta Workflows guides are questions and answers from the community office hours, the #okta-workflows channel on MacAdmins Slack, and other places. Read all the other guides.

How to export group membership to a CSV file and email the file?

This guide will teach you how to export Okta group membership to a CSV file and email the file.

Get group membership flow

This is the main flow:

Email group membership flow

This flow has the following steps:

  1. The Okta – List Group Membership card retrieves all users from the specified group ID.
  2. The List – For Each card processes each user from the list. It uses a helper flow to save user information into a table. See the helper flow and table below.
  3. The Tables – Export to CSV card exports table data into a CSV file.
  4. The Text – Compose card creates the email message.
  5. The Gmail – Send Email with Attachment sends a message with the CSV file attached.

Helper flow and table

This is the helper flow to save user information into the table:

Helper flow to save user information into table

The flow has the following steps:

  1. The Helper Flow card defines the input into the helper flow. The main flow passes the User object to the helper flow.
  2. The Object – Get Multiple card retrieves three fields from the User object.
  3. The Table – Create Row saves the three fields into a table.

This is how the table looks:

Workflows table with user information

The table has three columns to save user information: First name, Last name, and email.

Clearing the table

If you run the flow multiple times, user information will be appended to previous user information in the Workflows table. To start with a blank table before each run, add the Table – Clear card at the beginning:

Main flow with clear table card

Running the flow

The last step is to determine how to run this flow. A good option for this example is to use the Scheduled Flow card.

Video building the flow

This online meetup video shows how to build this flow:

Workflows resources

🍫 Get help from Workflows specialists during weekly community office hours.

πŸ“Ί Learn from Workflows videos.

πŸ›Ÿ Get help from support: discuss a Workflows topic or ask a question.

πŸ™‹πŸ»β€β™€οΈ Get help from the community: join the #okta-workflows channelon MacAdmins Slack.

Leave a comment