Question

How do I create a new Google Sheet with looked up rows and send it as an email attachment?

  • 20 September 2023
  • 5 replies
  • 70 views

Userlevel 1

Hello! I’m trying to look up rows from a google sheet > create a new sheet > email it over as an attachment using gmail. It would be best to just email over the rows that have been looked up as a table, but unfortunately it returns as a string.

 

Therefore, I think the best way is to create a google sheet instead and attach it to an email before sending off. Currently I’m stuck on creating a new sheet with the looked up values (not sure how to go about it). Below is my current flow where i’ve yet to create a new sheet. 

 

Ideal flow:

  1. User fills in a form and it gets recorded on a new sheet (done)
  2. Zapier to look up a column in a master database against one of the answers from the google form (done)
  3. Create a new sheet with the looked up rows (not done, need help)
  4. Attach the new sheet in email and send off to the form responder (not done, but I know how)

Hope someone is able to advise. Thank you!


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

5 replies

Userlevel 7
Badge +11

Hi @KF001, welcome to the Community!

To create the new spreadsheet you’d need to use a Create Spreadsheet (Google Sheets) action. Then, to add multiple rows to the spreadsheet you’d want to use a Create Multiple Spreadsheet Rows (Google Sheets) action. You want to select the spreadsheet using the Custom tab option by selecting the ID for the spreadsheet from the previous action: 

7fe520eb56e9129c94c9552a7203344b.png
This will ensure that the Zap adds the rows to the spreadsheet that it just created. And selecting the line items output by the Lookup Spreadsheet Rows (output as Line Items) action will allow it to add multiple rows to the relevant spreadsheet. 

Hope that helps to get you pointed in the right direction. If you run into any issues on that just let us know, happy to further assist! 🙂

Userlevel 1

Hey Sam, 

 

Thanks a lot for replying, it works!

I have a follow up question, when I create a spreadsheet, is there a way to custom name it with running numbers? I just want to make sure it’s uniquely named because now I have used: 

Sheet For {name}

But there might be a clash if someone inputs the same name in the Google Form. 

 

Thank you!

Userlevel 7
Badge +6

Hi there @KF001,

That’s awesome! Big thanks to Sam for pointing you in the right direction.

Additionally, have you found a solution for your creating a spreadsheet with running numbers?

Please keep us posted! 😊

Userlevel 1

Hey @ken.a ,

 

Thanks for checking in. I haven’t found a solution for this yet. Would you be able to advise how to address this problem? 

 

Thank you!

Userlevel 7
Badge +6

Hi @KF001,

You can probably add a Numbers in Formatter by Zapier action before the “Create Spreadsheet” step and choose the “Random Number” function so that every time the Zap runs the Formatter step will generate a random number and you map the output of the Formatter step to the “Title” field of your “Create Spreadsheet” step. Here’s an example:

14a1d98d8030fa90e26c35c6e8e7c36b.png
(view larger)

cd34673926dc04e3797829a6776940cf.png
(view larger)

f59b36189867b85b822c936a00109d65.png
(view larger)

Do you think this will work for you? Please let me know! 😊