Introduction:
In this article you’ll learn how to update google sheets directly.
You can use this to update google sheets with new leads. Or use your google sheets like a database and search or query your ‘database’ to bring back more information in your leadgen and marketing campaigns.
You can send data to google sheets or read data from google sheets or update a counter such as number of visitors to a node or your decision tree.
One of the main benefits is speed. Integration via Zapier to populate a Google Sheet can be slow. So this allows you to operate at speed and cut out the middleman and go straight from LH to Google sheets.
Step-by-Step Instructions:
- This is a test sheet with working code
- It should be much more reliable, as Zapier can miss a few calls from time to time.
Step 1. You need to be logged in to your google Account.
Step 2. You will need to make a Copy of the Spreadsheet which will be saved to your Google Account Sheets.
Step 3. Change my custom fields to your own, and the sheet name to your own from the code.
https://docs.google.com/spreadsheets/d/15RN-ea8Ld2cpGK7U2xvVLSQC_HHuZPCBDIzPSK1s2do/edit?usp=sharing
Step 4. Then go – Publish/ Deploy web app, and put the url in your webhook node in LH.
Here’s a video walk through:
IMPORTANT: Google Sheets had an update. “Script editor” Can now be found via Extensions > App Script
Troubleshooting:
When testing your webhook, you might get a 200 status code. Yet still it doesn’t work. If you examine the webhook response and see that part of it complains of a JSON syntax error.
SyntaxError: Unexpected token in JSON at position 81 (line 18, file "Code")
That likely means you have blank spaces in your webhook between the name/value pairs, that cause the syntax error.
“firstname” : “{firstname} //wont work
“firstname“:”{firstname} //will work
Step 1: Go to Extensions > Apps Scripts

Step 2: Copy & Paste Your Script, Save & Deploy

Step 3: Deploy with Correct Permissions
Please ensure to check your permissions or you won’t be able to access your google sheet app from the internet.
Be sure to “Deploy as Web App”

Step 4: Grab this URL and use inside your webhook or api node(s).

Step 5: Test & Confirm Your Setup is Working as Expected.