Skip to content

Triggering a Zap from Google Sheets with a Button

This guide explains how to use Google Sheets, Google Apps Script, and Zapier to create a trigger that starts an automation with a button click. This method was developed to track project milestones in Asana, overcoming the limitations of Asana's reporting features.

The Challenge

Our client needed a way to monitor project milestones within Asana, but the platform's reporting tools were insufficient. We decided to build a custom milestone tracker using Google Sheets, enhanced with automation from Zapier.

The Solution

We used Google Sheets to create the tracker and added a custom button to initiate the Zapier automation. Here's how we did it:

Step 1: Preparing Zapier

We set up a Zapier webhook as our trigger instead of using a scheduled trigger. This allows us to start our automation whenever the button is clicked. Zapier generates a unique URL for this webhook.

Step 2: Google Sheets Configuration

In Google Sheets, we added a drawing that serves as our button. This button, when clicked, will trigger our automation.

Step 3: Connecting with Google Apps Script

Through Google Sheets' Extensions menu, we accessed Google Apps Script and inserted code that calls the Zapier webhook URL when the button is clicked. This connects our button in Google Sheets directly to our Zapier automation. Here's the code for the function:

function sendGetRequest() {
var response = UrlFetchApp.fetch('https://hooks.zapier.com/hooks/catch/11684903/30b2ea0/silent/');
Logger.log(response.getContentText());
}

Step 4: Testing

After setting everything up, we tested the button to ensure it triggered the Zapier automation as expected. We also discussed adding a "Last Updated" flag to the tracker for better data transparency.

Conclusion

This setup provides a flexible way to automate tasks from Google Sheets, offering solutions for tracking and updating project milestones, among other applications.

Further Steps

If there's interest, I can detail the construction of the entire Asana tracker, including technical steps like using VLOOKUPs and custom code.

I'm curious to hear about your potential uses for this setup and encourage experimentation to enhance your workflows. Feel free to share your experiences and insights.