<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
Save Deactivated Users, Export as CSV, and Email in Workflows
Okta Classic Engine
Okta Identity Engine
Workflows

Overview

This article will cover how to save and export deactivated users into a CSV file and email the file Okta Workflows.

The solution has two flows:

  • Flow 1: save the deactivated users into a Workflows table.
  • Flow 2: export data from a table as a CSV file and email it.

Solution

Save deactivated users into a Workflows table

The first flow runs when a user is deactivated and saves user information into a table.

 


Save deactivated users into a table.

Flow steps

 

The flow has the following steps.

 

Run when a user is deactivated

 

The Okta – User Deactivated event runs the flow.

 

Read user information

 

The Okta – User Deactivated event provides minimal information about the user. The flow uses the Okta – Read User card to obtain additional information about the user.

 

Save user information into a table

 

The Tables – Create Row card saves user information into a table.

 

The table looks like this:


Table with deactivated users.

Export to a CSV file and email

The second flow runs daily, exports the users to a CSV file, and emails the file.

 


Export users to a CSV file and email the file.

Flow steps

 

The flow has the following steps.

 

Run on schedule

 

The Okta – Scheduled Flow card runs the flow on schedule, for instance, daily or weekly.

 

Export to CSV

 

The Tables – Export to CSV card exports table data to a CSV file. The card configures which columns to export.

 

Get today’s date

 

You want to include the date the flow ran in the email. The Date & Time – Now card returns the current time.

 

Convert today’s date

 

The Date & Time – Convert card converts the time to a specified time zone.

 

Create email

 

The Text – Compose card sets the email subject and body.

 

Send email

 

The Gmail – Send Email with Attachment sends an email with the attached file.

 

Result

 

When the flow runs, it sends the following email:

 


Email with attachment.

Related References

 

 

Loading
Save Deactivated Users, Export as CSV, and Email in Workflows