How Google Sheets and Webhooks made my life easier!


2 min read

I work in Tech Support and Google Sheets helped me automate repetitive tasks!

This helped me push messages to various teams who use Google Chats, the Webhook option present in Google Chat is amazing.

The Goal was to track Incidents(Outages) and then push notifications to various teams which was manual before I found out about Google Sheets Simple Triggers.

Here are few links that might help you get started.

How to Build Apps using Google App Script

Read more about Google Sheets Triggers here

Read more about Google Chat Incoming webhooks

Now all we had to do was enter the data in a specific Cell and the onEdit() function would read it and post it to the necessary chat rooms.

You will need to add the trigger from Google Scripts

Enough talk! Show me the code!

function myEditNew(e) {
// The e is an event Object

if (e.value)

Logger.log("Data: "+e.value);

var val=e.value;
// This function is to get the current user that created the task its documented in the Gist at the end of the post
var cur_user=getCurrentUserEmail();

var text = Utilities.formatString('Incident created by *%s*: ```%s``` <users/all>',cur_user,val);

//1. Bot Test room
// [Args[Webhook URL, Space Name, Thread Name]]

// To get the Thread ID read this Stackoverflow answer


var urls = [


// Lots of Logging to see if Things are working properly.

if (e.range.getA1Notation().startsWith('C') && val != "")
// Synchronously Post it to the Rooms
var payload={
var options = {
  'method' : 'post',
  'contentType': 'application/json',
  // Convert the JavaScript object to a JSON string.
  'payload' : JSON.stringify(payload)

// UrlFetchApp Documentation
var response = UrlFetchApp.fetch(urls[i][0], options);



Github Gist of the entire code

Thank you for reading, if you like this article feel free to share it as always I'm open to constructive feedback and criticism, feel free to leave a comment or message me.