top of page

Let's Parse a CSV File Attached to Email

Writer's picture: Sean FieldingSean Fielding

In a recent implementation of Email-to-Flow, we implemented a process to


  • receive an email

  • ingest the attached csv file(s)

  • parse the contents of the csv file(s) into usable data

  • create cases record(s) from the parsed data


The .csv File

The client received a daily email from a third-party vendor. This email includes a .csv file of repair requests that have been authorized.

The .csv has been simplified for demonstration purposes.
The .csv has been simplified for demonstration purposes.

The Flow

Let's examine the details of the flow.


Flow simplified for demonstration purposes.
Flow simplified for demonstration purposes.

Step 1 - Find the .csv files

In the first step, we loop over the Email Attachments (provided by the Email-to-Flow email service), searching for a .csv file to process.


Step 2 - Parse the .csv files

Leveraging the Email-to-Flow Parse CSV File apex action, the .csv file is parsed into lines and key value pairs.


Step 3 - Group the results by store code

We built a custom Flatten Results apex action to group the parsed data by the unique store code value.


Step 4 - Find the account

Using the store code, we identify the correct Account. Once found, the results of the .csv file are added to the case.


Step 5 - Create the Case(s)

Finally, we create the case(s).

Comments


bottom of page