Reputation: 31
I'm trying to connect my Google Sheet with a Slack Channel. The use case is as follow: I have a Google Sheet which looks like this:
There are around 50 so called topics, each of them has internal and external experts listed, also some related files. For now, only the internal experts column of each topic is of interest. Whenever a new person is listed as an internal expert (new cell on the bottom of the column), I want to send out a message to a related slack channel which looks like this:
The message should contain the name or content of the added cell and the name of the Topic he/she was added in as an internal expert (in this case "Topic 1"). The rest is a predefined string. As you can see, I tried to do this with Zapier, and it works. The problem is with Zapier, there seem to be too many limitations when working with several columns. As far as I know, I would have to create a separate Zapier Action for each column, which isn't a really nice solution.
Does anybody can give me a hint how to build this with a Google Script (+ Slack Webhook)? Or if it even makes sense to do so? I'm not an expert in JavaScript + datasets, so I'm struggling a bit on how to start this.
Upvotes: 1
Views: 3588
Reputation: 32737
I would suggest to take a look at Triggers for Google App Scripts. You can set a trigger to run every time your Google sheet is edited - see onEdit()
. Your trigger can than check if the edit is relevant (e.g. new cell at the bottom of a specific column) and send a request to Slack using incoming webhooks.
Upvotes: 2