Parse CSV

<< Click to Display Table of Contents >>

Navigation:  NITRO™ Workflows > Configuring Workflows > Workflow Actions >

Parse CSV

The Parse CSV action is used to read a CSV file and populate or update a SharePoint list.

 

Parse CSV Action in Designer Workflow:

 

 Parse CSV in designer

 

 

 

Parse CSV Action in legacy Workflow:

 

Parse CSV in legacy

 

Conditions - Will set conditions as to when to  run the Workflow action.

 

Action Name: enter a unique name for 'Parse CSV Action'.

Action Description: enter a description for 'Parse CSV Action'.

Run for:

This specifies the source for CSV data.

 

oCurrent Item: Read the CSV data from current item.

 current item

oQuery List: Read the CSV data from one or more items fetched as part of a query list action.

Query List Action

 

oVariable: Read the CSV data from a workflow variable.

Run for variable

oLoop Item: Read the CSV data from one or more items on which loop runs. Loop Item shows only those loop control names in dropdown

that run on query list.

Loop Item

 

Delay Execution - Will delay the execution of the Parse CSV action by a specified number of seconds.

 

 

Get CSV data from - Select one of the options to read CSV data.

 

Attachments: Select this option if CSV data is in one or more item attachments. We can filter the files by specifying the type of the file. 

For example, we can enter file extension as .csv.

 

Note that all matching attachment files will be processed if there are multiple attachments in the item. supported extensions are ".csv" and ".txt".

 

Column: Select this option if CSV data is in a column in the list item. Multiple lines of text type columns are listed for this purpose.

 

CSV Operation - Select one of the options to add/update items in target list, set CSV data in variable or select 'Both' to add/update items in target list 

from CSV data and set CSV data in variable.

 

       Add/Update Item: select this option to add/update items in target list by parsing csv data getting from csv file. when you select this option,

below shown settings will be visible.

 

 

Add Update Item

 

Target List Settings:

Select target site and list to create or update the items.

 

Content Type:

If target list is 'Custom list' then it will show 'Default' and 'Item' as a default option in dropdown.

o Default: it will create item in target list with specified column mappings

o Item: it will create item in target list with specified column mappings

If target list is 'Document Library' then it will show 'Document' and 'Folder' as a default option in dropdown.

Note: If target list is 'Folder' enabled then 'Content Type' will show Folder as third option.

To enable folder option: Go to list -> List settings -> Advanced settings -> Folders, here select 'Yes' and click 'Ok' button.

New Folder

 

o Folder: it will create folder in target list with specified column mappings.

For more detail on content types refer: Steps to add content types to SharePoint List

Column Mappings and Advanced Settings: for Column Mapping and Advanced settings refer this article

Note:

In column mapping, supporting list column placeholders and functions for which parse csv action is running.

Map list columna nd function

Support Multi selection enabled lookup and person or group columns

Support Multi choice column type

Support ";",";#","," separator in LookupMulti, MultiChoice and MultiUser column

 

       Set in Variable: select this option to set CSV data in a variable. User can configure a variable by clicking '+' button. All configured variable

in workflow or variable configured with '+' button will be shown in drop list. User can use this variable in loop control to add/update items in target list.

 

Set in variable

 

Expression used in add/update action to map column value from CSV file data stored in a variable is:

VariableName##CSV file Column Internal Name

Sample Example:  Variable Name: varRowData

                 CSV file column name: Item

                 Expression to map 'Item' column value in target list column: varRowData##Item

 

Sample Example: Get 'Purchase Items' data from CSV File and add this data in 'Purchase Items' SharePoint list

 

Add Purchase Items workflow

 

Define Variables:

 

Define CSV Variables

 

Action 1 (Parse CSV Action): Get CSV Data

 

Parse CSV Action Setting

 

Action 2 (Loop Control) : Parse CSV File Data

this loop control will run for csv file data that is stored in variable 'ParseCSVFileData'

 

Loop Control Setting

 

Action 3 (Set Variable) : Get Each Row Data from CSV File

This will set the current loop value in variable 'varEachRowData'

 

Set Variable values

 

Expression Builder Syntax:

 

Expression Builder Syntax

 

 

Action 4 (Create Item Action) : Add Purchase Items

 

Add Purchase Items

 

This workflow is configured on Item creation event on 'Purchase Order' list. when an order is created with 'Purchase Items' csv file.

All 'Purchase Items will be created from CSV file to 'Purchase Items' SharePoint list as shown below:

 

Input CSV File data:

 

CSV File Data

 

 

Purchase Items list:

 

Purchse Items List

 

 

 

       Both: select 'Both' option to add/update items in target list from CSV data and to set CSV data in a variable.

functionality is same as add/update item and set in variable defined in above section.