Question

Using Zapier to trigger Google Sheets script / macro

  • 16 July 2023
  • 8 replies
  • 442 views

I’ve got a script that takes several worksheets in a Google Sheet and saves it to a single PDF using a formula for how to name that PDF etc.

 

I’m a fairly advanced user and thought it would be pretty easy to create a Zap that triggers that Script, then retrieves a download PDF link to the file, so that I can then send that file using Zapier / Gmail and then also store it in a specific sub-folder of my choosing again using Zapier / Google Drive.

 

See attached screen shots. I’m stumped. Out of my comfort zone and need your help please!

 

The script updates the Google Sheet with data from a TypeForm first, fails to trigger the script, but it does then send the email (but without the desired PDF).

 

Love Zapier and know there is a way but so frustrated after 24 hours of trying everything I could think of and still falling short. Basic direction I took was from the only article on here from like three years ago that addressed the use case but wasn’t super specific on how to calibrate the settings etc.

 


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 +14

Hi @Action 

Good question.

What is the API documentation you are referencing for how to configure the POST request in the Zap action?

 

The return HTML shows this:

 

Observation

You have the serachStringName twice.

Once in the URL.

Once in the Data section.

 

 

Thank you for your timely reply.  So should I leave the two boxes below “Data” blank? 

Troy, here’s the link that I was referring to -- wasn’t API, but rather this: https://community.zapier.com/how-do-i-3/how-can-zapier-trigger-a-google-sheet-script-to-run-5454#:~:text=Just%20create%20a%20webhook%20at,data%20from%20the%20POST%20request.

 

Userlevel 7
Badge +14

@Action 

Did you make this fix?

 

Observation

You have the serachStringName twice.

Once in the URL.

Once in the Data section.

 

So I deleted the data row. Re-ran. Didn’t work. It produced this output -- which is way beyond my understanding to interpret -- hence, reaching out for help from someone who might have superpowers in this arena.


<!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Error</title><style type="text/css" nonce="812yF7dbfxT5fi2nGMOdGw">body {background-color: #fff; margin: 0; padding: 0;}.errorMessage {font-family: Arial,sans-serif; font-size: 12pt; font-weight: bold; line-height: 150%; padding-top: 25px;}</style></head><body style="margin:20px"><div><img alt="Google Apps Script" src="//ssl.gstatic.com/docs/script/images/logo.png"></div><div style="text-align:center;font-family:monospace;margin:50px auto 0;max-width:600px">SyntaxError: Unexpected token &#39;C&#39;, &quot;COL%24A=&amp;C&quot;... is not valid JSON (line 137, file &quot;Code&quot;)</div></body></html>

 

Userlevel 7
Badge +14

@Action 

Perhaps try reaching out to the Zapier Community user who provided the answer in the linked post.

Troy, that’s a great suggestion, I just did that. Thank you again. Stefan