Using For Each Excel Or CSV Row StepLast Updated: 06/07/2018 Introduced in Version: 2.0
This tutorial demonstrates how to use For Each Excel Or CSV Row step. This step can be found in Data > List > Excel and CSV category in the ToolBox.
In this example we are going to create a Flow that creates new Accounts using data from the Excel file. Also, this Flow will show a pop-up Notification for each Account that was created from the Excel file.
We begin in the Designer Folder with clicking Create Flow on the Folder Actions panel.
Next, we Name the Flow and click Create to proceed to the Flow Designer.
In the Flow Designer we need to create a Data that will hold our Excel File. We add Create Data step from Favorite Steps category in the Quick Add Step dialog.
In the resulting Data Definitions window we click Add New to define new Data.
Then, in the Add DataDefinitions window we Name our Data and select its Type FileData. Click Ok to save and close Add DataDefinitions window.
Next, we can pick an Excel file for Create Data step. The Excel file for this example looks as following. It has 3 columns with First Name, Last Name, and Email Address.
In the Flow Designer we select Create Data step on the workspace and Step Information Layer pops up. We use Choose File for the ExcelFile data in the Inputs section to pick our Excel File.
Next, we add For Each Excel Or CSV Row step from All Steps [Catalog] > Integration > Excel and CSV category in the Steps panel.
To configure Data for this step we select Edit Input Mapping from step’s Edit Pop Up.
In the Mapping Editor we connect ExcelFile output from Create Data step to the File Input field. Then, we click Ok to save and close Mapping Editor.
Back in the Flow Designer we select For Each Excel Or CSV Row step on the workspace to pop up Step Information Layer. Then, in Input Data section from the Input File Type dropdown we select Excel_xlsx because our Excel File has .xlsx extension.
On the Next Row outcome from For Each Excel Or CSV Row step we add Create Account step from Integrations > All Integrations > Accounts category in the Quick Add Step dialog.
Then, we Edit Input Mappings for the Create Account step…
In the Mapping Editor we expand Current Row outcome from the For Each Excel Or CSV Row step. We connect Text Value from the Field03 to the emailAddress field, and Text Value from the Field01 to the password field. Then, we save and close Mapping Editor.
Back in the Flow Designer we add Show Popup step from Favorite Steps in the Steps panel to the Done outcome from Create Account step.
We call Mapping Editor for the Show Popup step to configure its Data.
In the Mapping Editor we use Constant text for the Subject field and Text Merge.Plain Mapping type for the Message field. Then, we click Show Editor for the Message field.
In the Merge Text Editor we use TextValues from Fields in the Current Row to reflect an information about currently added Account. When finished, we click Ok to save and close Text Merge Editor. Then, we can save and close Mapping Editor.
Back in the Flow Designer we connect steps in our Flow in the following manner, and click Debug Flow link to test the Flow.
Our flow executes in the Debugger with no errors and we can see Pop-up Notifications indicating that 3 new Accounts were added…
We close the Debugger and the Flow Designer. In the Portal we navigate to the System > Security > Accounts Folder, and confirm that four new Accounts were added to the Portal.