How to send Notifications to Google Chat on Google Form Submit using Webhook
Send a message to Google Chat when a user submits a Google form by following the steps below.
-
Create Incoming WebHook in Google Chat:
- Open the Google Chat room where you want to receive notifications.
- Click on the room settings (gear icon) and choose "Manage webhooks."
- Click on "Add Webhook" to create a new Webhook.
- Copy the generated webhook URL, which will look like
https://chat.googleapis.com/v1/spaces/SPACE_ID/messages?key=KEY&token=TOKEN
. - You can follow the instruction here to create an incoming webhook for Google chat
-
Create a WebHook in Form Email Notifications:
- Open the Form Email Notifications add-on and click on "Setup Webhooks."
- Click on "Add Webhook" to create a new Webhook.
- Fill in the following fields in the Webhook creation window:
- Webhook Name: Google Chat Integration
- URL: Paste the Google Chat Incoming WebHook URL you copied.
- Request Method: Select POST.
- Headers: Leave as is with a default header (Content-Type: application/json).
- Request Body: Use the following JSON template:
{"text": "New response for Google form <{{ Form Publish Url }}|{{ Form Name }}>"}
- Click on Save to create your webhook.
-
Test Your Webhook:
- You can test the webhook before saving by clicking the "Test" button on the Webhook Editor Window.
- If you receive a status code as 200, it means your test was successful.
-
Submit the Google Form:
- Open the Google form preview by clicking on the Preview button on the top right of the Google form window.
- Submit the form, and if everything is configured correctly, you should receive a notification in your Google Chat room.
note
The process to create webhook and the json format may have changed after this page was written .Please check Google chat developer document for more details.