top of page

E2F: Parse CSV Files

Leverage the Parse CSV apex action to parse a CSV file into an Apex Defined variable for further processing. This process assumes:

​

  • The file is .csv file format

  • Data is double quote escaped

  • File contains headers in the first row.

Inputs

ContentVersion

Required

The content version which represents the csv files. 

Outputs

AllLines

Returns a list of parsedCSVLines.

isSuccess

False if an error occurred during the process

ErrorMessage

If IsSuccess is false, the error message

ParsedCSVLines

ParsedCSVLines is a custom apex defined variable that contains the following data points.

Line

Line number that corresponds to the csv file.

List of ParsedCSVKeyValuePairs

ParsedCSVKeyValuePairs is a custom apex defined variable.

ParsedCSVKeyValuePairs

ParsedCSVLines is a custom apex defined variable that contains the following data points.

Key

The file name based on the column header.

Value

The value contained in the csv file.

Parse CSV File in Action

Below is a simplified example of the Parse CSV File in action. An initial loop over the results will provide insight into each line. A secondary loop over each line will provide insight into each column header and column value.

ParseCSVFlow.png

File Example

For example purposes, the following .csv file is processed by the above flow.

example csv.png

Run the flow in debug mode and inspect the results.  Reviewing the first line, we see Store Code is set to 12345 and Part is set to Drive-Thru.

Debug.png
bottom of page