- 16 Nov 2022
- 2 Minutes to read
- Print
- DarkLight
Using For Each Excel Or CSV Row Step
- Updated on 16 Nov 2022
- 2 Minutes to read
- Print
- DarkLight
Overview
This tutorial demonstrates how to use For Each Excel Or CSV Row step. This step can be found in the Data > List > Excel and CSV category in the ToolBox.
Example
In this example, 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 created from the Excel file.
Begin in the Designer Folder by selecting Create Flow on the Folder Actions panel. Name the Flow and select Create to proceed to the Flow Designer.
In the Flow Designer, create a Data that will hold the Excel File.
Add Create Data step from Favorite Steps category in the Quick Add Step dialog. In the Properties panel under Data > Data to Create, select Show Editor to define new data.
In the Data Definitions dialog, name the Data and select its Type as FileData. Select the proper excel file for the Input. Click 'Ok' to save and close.
The Excel file for this example looks as following. It has 3 columns with the First Name, Last Name, and Email Address.
Next, add For Each Excel Or CSV Row step from All Steps [Catalog] > Integration > Excel and CSV category in the Steps panel.
With the For Each Excel or CSV Row step selected, in the Properties panel under Inputs, connect the ExcelFile output from Create Data step to the File Input field. In the Input Data section from the Input File Type drop-down, select Excel_xlsx because the Excel-File has .xlsx extension.
On the Next Row outcome from For Each Excel Or CSV Row step, add Create Account step from Integrations > All Integrations > Accounts category in the Quick Add Step dialog.
In the Properties panel under Inputs, connect Text Value from the Field03 to the emailAddress field, and Text Value from the Field01 to the password field.
Next, add a Show Popup step from Favorite Steps in the Steps panel to the Done outcome from Create Account step.
In the Properties panel under Inputs, use Constant text for the Subject field and Text Merge.Plain Mapping type for the Message field. Then, select Show Editor for the Message field.
In the Merge Text Editor, use TextValues from Fields in the Current Row to reflect information about currently added Account. When finished, select 'Save' to save and close Text Merge Editor.
Back in the Flow Designer, connect steps in the Flow click Debug Flow link to test the Flow.
The flow executes in the Debugger with no errors and the Pop-up Notifications display indicating that 3 new Accounts were added.