How I explored Google Sheets to Gmail automation through Zapier before building it in Python (part 1)
View the series
- See how I built my first Zapier Gmail alert from Sheets updates
- Check how I switched from Zapier to a Python polling script
Yesterday, I built and published my first Zapier ↗ Zap with the Zap editor.
The automation: Send emails via Gmail when Google Sheets rows are updated.
More precisely, for the "zapier test 1" Google
spreadsheet,
whenever a row is added or updated in the
"Sheet1" sheet, send an email to the
email field. The content of
the email is taken from the
note field.
The user experience was smooth and quick.
Remember, a Zap is an automation made up of one trigger and one action. In other words: When this happens, do this.
Here are the steps I took:
-
I selected the Gmail app on https://zapier.com/apps/ ↗ page.
-
On the Gmail integrations ↗ page, I picked the Google Sheets app.
-
I requested more details about the automation: "Send emails via Gmail when Google Sheets rows are updated."
-
On the description page ↗, I clicked "Try this template." That took me to the Zap editor ↗ with the Google Sheets trigger and Gmail action already selected.
-
I authorized Zapier to access my Google Sheets, Google Drive and Gmail accounts.
-
I selected the "Sheet1" sheet in the "zapier test 1" spreadsheet and specified how to use the data to compose the email.
-
I ran the tests for the trigger and the action. Both worked.
-
Then I published the Zap.
Now comes an interesting part.
I wanted to see how this Zap behaves and how Zapier handles errors. How can I access the logs? Do they have logs? Are they insightful?
All of this matters because, when everything works, we live in a happy world. But when systems break, how can we troubleshoot? This is important, and it's better to think about it before a problem happens rather than after.
This is also what sets apart a product you can rely on from the rest.
So, here's what I did.
No spam. Unsubscribe anytime.
I added a row with the
name as "bar" and
left the other two fields empty, just to see what would happen:
Nothing, if the trigger requires a complete row or
-
An error, because the
emailandnotefields are required.
An error did happen, and I got notified by email:
the email and
note fields are required. I
could also see the error logged in
Zap history ↗:
Something cool is that
I could troubleshoot the error by looking at the
corresponding Zap run (016eba4d-4db5-ae11-a121-210f174f6081) at the Zap editor:
This Gmail step hit an error
Required field "body" (body) is missing.
In the Zap editor, I clicked on the "Troubleshoot" tab to get AI-generated details about my error:
What this error means:
The error indicates that the Zap is trying to use data from a previous step, specifically the "to" and "body" fields, but it appears that the expected values were not passed correctly. This could be due to the previous step not outputting the necessary data or the data being in an unexpected format.
How to fix it:
Check Previous Step Output: Review the output of the previous step (Google Sheets) to ensure that it contains the expected values for "COL$B" (recipient email) and "COL$C" (email body).
Verify Data Mapping: Ensure that the fields in the Gmail action are correctly mapped to the outputs from the Google Sheets step. The "to" field should map to the email address and the "body" field should map to the email content.
Use Formatter Step: If the data needs to be extracted or formatted, consider adding a Formatter step before the Gmail action to ensure the data is in the correct format.
Test the Zap: After making adjustments, test the Zap to confirm that the email sends successfully with the correct data.
For more info check out:
How to automatically extract data from your apps to use in your Zaps
Common Problems with Gmail on Zapier
What HTML tags are supported in Gmail?
In cases where the error isn't due to missing required information (like in my case), you can access the Zap's HTTP log under the "Logs" tab.
For more troubleshooting tips on Zap errors, check this out: https://help.zapier.com/hc/en-us/articles/8496037690637-How-to-troubleshoot-errors-in-Zaps ↗
Everything worked well when I filled in a row completely with the expected fields.
Cool first experience with Zapier. Automation made easy.
That's all I have for today! Talk soon 👋