In this article, we’ll walk you through how to connect a spreadsheet tool to a messaging platform using a webhook and an automation script. This is a simple way to send automatic messages to a channel whenever changes are made to a sheet.
In the steps below we will set up a script to send a message to a sample messaging platform whenever the sheet is edited. Here are the steps:
Webhooks let you send automated messages or data into a specific channel in your messaging app. To create one, hover over the channel name where you want updates to appear.
A gear icon will appear named Edit Channel. Click it.
After loading the channel settings, click Integrations in the left sidebar.
On the Integrations page, the option Webhooks is listed. Click Create Webhook.
A new webhook will be automatically generated. Click it to change its name and copy the URL.
We will come back to this page as we need the webhook url for the next step.
To start, click Extensions then select Apps Script.
A new tab will appear.
Delete the sample code in the code body, then copy the code from this link.
In the code, look for a line that includes the webhook URL and paste the one you copied earlier. It's typically around line 8 of the script.
Once you are done, click the Save button.
We also need to install a trigger to ensure the script runs correctly. In the Apps Script tab, hover your cursor over the left sidebar. A list will appear. Click Triggers.
The list of triggers will appear. Click Add Trigger on the lower-left corner of Apps Script.
A box labeled Add Trigger for Untitled project will appear. Use the following settings:
Choose which function to run: onEdit
Choose which deployment should run: Head
Select event source: From spreadsheet
Select event type: On open
Failure notification settings: Notify me daily
Click Save afterwards.
You will need to authorize the script first. A new window will be loaded asking you to choose your account. Most of the time, only the account you are using to create the sheet will be listed. Select it.
A warning may appear about the app not being verified. Click the link labeled Advanced at the bottom of the message. A link labeled Go to Untitled project (unsafe) will appear. Click it.
A list of permissions needed by the app will be listed next. Click Allow.
The window will close and you will be brought back to your sheet. The trigger you set will now appear listed.
Hover your cursor to the left sidebar again, then click Editor.
Click Run the selected function.
Once it runs, you can close the tab. From now on, any changes made to the spreadsheet will trigger a message to your messaging platform, showing the sheet name and the edited range.
We hope this article has helped you and given you a better understanding of how to connect your spreadsheet to a messaging app.
To optimize your workflow, we recommend reading our guide on how to extract a name from an email address.
Google Sheets IF Multiple Conditions (Easiest way in 2025)
How to Fill Down in Google Sheets in 3 Simple Steps