This tutorial demonstrates how to build a Flow that imports users from a flat file like an Excel Online Spreadsheet or a Google Sheet. If you have used the Okta CSV Directory Integration before, this Flow can automate that process. Unlike previous tutorials that are triggered by an event, this Flow is built on a scheduled, recurring basis.
There are five tasks in this tutorial:
- Build the parent Flow
- Build the child Flow
- Connect the Flows
- Designate the objects to import
- Run and test the Flow (note that you can test a Flow or individual card at any time)
- Create a Google Sheet or an Excel Online spreadsheet with at least two users to import. Name the columns
- Connect your Okta application.
- Connect the app you used to create the Google or Excel sheet.
Build the parent Flow
- In Admin Console, go to Workflow > Workflows Console.
- In Workflows console, click New Flow. Or, if you have a folder where you want to store this Flow, open it and click Create a Flow Now.
- Name your Flow Import Users - Parent Flow.
- Click Add New Event, and then select Schedule from the Okta Apps menu.
- In Flow Schedule, set a weekly frequency.
- In the second card, click App Actions, and then select the app you used to create the CSV file (Google Sheets or Excel).
- In the Actions menu, select Read All Rows.
- In the Read All Rows card, select your spreadsheet and the worksheet number where your users are stored, and then click Done.
- Verify that your four CSV file column names are selected, and then click Done.
- Click Add Another > Function > List > For Each.
- Drag and drop the Rows field in the Read All Rows card to the list field in the For Each card.
Build the child Flow
- In the For Each card, click Choose Flow.
- In the folder window, click New Flow.
- Enter the name Import Users - Child Flow.
- Click Add New Event, and then select Child Flow from the Okta Apps menu.
- In the Inputs to this Flow field, enter Rows. This will map the Rows field from your parent flow to your child flow.
- Save the child Flow and all of its data. If you get an error, verify that the child Flow is configured correctly, and then try again.
Connect the Flows
- Return to the parent flow, and in the For Each card, click Choose Flow.
- Select Import Users - Child Flow.
- In the Rows drop-down menu, select Item.
- Save the parent Flow and all of its data. Note that you cannot save a parent Flow that contains a child Flow unless unless that child Flow is active.
- Toggle the Flow is OFF switch to ON.
Designate objects to import
- In the child flow, click Function > Object > Get Multiple.
- Drag and drop the Rows field in the Child Flow card to the object field in the Get Multiple card.
- In the Get Multiple output field, enter the following values. Note the syntax matches your API details in the tested flow.
- Click Add Another > App Action. Select Okta. If you’re prompted to choose a connection, follow the steps and click Done.
- In the Okta menu of actions, select Create User.
- In the Option drop-down menu, select without Credentials, and then click Done.
- Verify the fields you want to see in your user profile, and then click Done.
- Drag and drop the column names from your Get Multiple card to the appropriate Profile fields in the Create User card. Note that userName maps to Login.
- Save the flow and all of its data. Don’t activate the Flow yet.
Run and test the Flow
- Return to the parent flow, and then click the Test Flow icon.
- In Flow History, verify that your parent Flow completed successfully.
- In Flow History, verify that your child Flow completed successfully.
- In Admin Console, go to Directory > People, and search for the users in your spreadsheet.