Best answer

Parsing or Saving CSV Email Attachment into Google Sheets

  • 3 February 2020
  • 8 replies
  • 5468 views

Userlevel 1

Hi everyone, I'm hoping the community can help me with setting up my zap...

I get a daily email from one of our vendors with an attached csv. I download & port the contents of this CSV over to a google sheet for records keeping / processing every day (mega repetitive).

My ideal scenario would be: gets daily email > zap creates new row in google sheet from each row in attached CSV.

I would also settle for a scenario where zap simply creates a new google sheet from attached CSV in a designated folder.

Thus far, I've tried using the email parser, but haven't been able to get it to recognize the attachment.


icon

Best answer by steph.n 4 February 2020, 02:31

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

8 replies

Userlevel 7
Badge +8

Hi there @Martin,

thanks for writing to us on our community!

I took a look at your zap, and I noticed that you have New Attachment in Gmail trigger set up. I recommend adding Formatter by Zapier with a specific focus on Utilities just like how we have outlined it here in our support documentation https://zapier.com/apps/formatter/help#how-import-csv-files-formatter before your Create Spreadsheet Row in Google Sheets step.

Please give this suggestion a try and let me know if that worked for you.

 

Userlevel 1

@Stephanie this worked! I first had to add a step to convert XLSX to CSV with CloudConvert, and change the Sheets setup to Create Spreadsheet Row(s), but after that worked like a charm. Appreciate the help.


Userlevel 1

Good afternoon, @Stephanie and Martin, I have a similar scenario. I get a daily email with a csv attachment and wish to zap the contents of that attachment over to a Google Sheet for updating a daily basis. I’d really love it if we’re able to update a sheet as opposed to create a new sheet daily. 

Userlevel 7
Badge +12

Hi @ajcheek1 You can absolutely do this so that it add rows to an existing sheet, rather than creating a new one. 

 

You’ll still need the Formatter step - that’s what converts the csv file into line items that Google Sheets can use. When you add your step choose the Formatter by Zapier app, then select the Utilities option and when you’re in the ‘Customize step’ section, choose ‘Import csv file’.

 

This will output the csv file as line items. You then add a Google Sheets Create Spreadsheet Row(s)  step to the Zap and use the line item output from the Formatter step to create the rows in an existing Google Sheet. This help guide breaks that down into steps that you can follow if you need some more detail. 

 

Let me know if you have any questions!

 

 

Hi there @Martin,

thanks for writing to us on our community!

I took a look at your zap, and I noticed that you have New Attachment in Gmail trigger set up. I recommend adding Formatter by Zapier with a specific focus on Utilities just like how we have outlined it here in our support documentation https://zapier.com/apps/formatter/help#how-import-csv-files-formatter before your Create Spreadsheet Row in Google Sheets step.

Please give this suggestion a try and let me know if that worked for you.

 

@steph.n @Danvers I have the same exact need as @ajcheek1. Can you send more detail on the exact Zap or Zaps needed? I now know I need the Formatter by Zapier step, but I want to be clear on the rest of the recipe.

Userlevel 7
Badge +12

Hi @jfalk, thanks for your question!

It depends on the details of the situation, but broadly speaking you would have something that looks like this:

  1. Trigger: Gmail - New attachment
  2. Filter: Only proceed if the attachment is a CSV that you want to use the Zap to process
  3. Formatter: Utilities > Import CSV file
  4. Google Sheets > Create Spreadsheet Row(s) The ‘(s)’ is important here!

 

If you need some more specific guidance, could I ask you to create a new post with the details of what you’re trying to do? For example, where the csv comes from, what you need to happen in Google Sheets when it does? That will help us to make sure that we can give you advice to your specific case 🙂

EDIT: Created a new thread

Hi guys,

I have a similar situation which I’m using the Formatter step for as recommended above by @steph.n - the Import CSV step downloads the CSV from a URL for me. Perfect.

But the problem is I’m unable to map the the columns of the CSV to Google Sheets’ columns due to 3 rows on top of the CSV. These are one of those rows that have additional context added by the sender. They are always the same albeit a row with dates. 

Ideally, I would like Zapier to strip those 3 rows and then parse the CSV so it correctly identifies the columns that I would then be able to map to Google Sheets. But apparently Zapier doesn’t have the feature (talked to Spencer on email) and not sure when the stripping of rows will be available. 

So I turn to you to see if there are any other recommendations. I believe stripping the initial 3 rows everytime the URL generates the csv is the missing link here.