Skip to main content

Post Messages to Google Hangouts Chat for Google Sheets Rows

Document Studio enables you to post messages to any room in Google Chat from your Google Sheets. When a new row is added in Google Sheets, you can send push messages to Google Hangouts Chat and keep your team up-to-date.

Create a Google Chat room

Sign-in to Google Chat with your Google account. Under the Rooms section, click the+ button to create a new room. Give your room a name of your choice and enter names of the people or groups you want to add. Next, click on Create.

Create Google Chat

Create a Webhook

Now that your room is created, click on the arrow where the name of your room is displayed. Select Manage webhooks from the dropdown. In the dialog box that appears, give your webhook a name and click on Save. Copy the webhook URL to your clipboard.

Manage Webhooks in Google Chat

Connect Google Chat to Document Studio

Install the Document Studio add-on and open your Google Sheet to launch the add-on. You may either open an existing Google Sheet or create a new sheet and add data in one or more rows of the sheet.

Inside the Document Studio app, provide a descriptive name for your workflow and choose the specific worksheet in your Google Spreadsheet that contains the merge data. Click on Continue to move to the conditions page.

Google Chat Workflow

On the Conditions pane, specify if you want your workflow to run only if the rows in the Google Specific sheet satisfy certain conditions. By default, the workflow will run for all rows in the sheet that contain data.

Next, choose Google Chat from the list of available tasks.

Post to Google Chat

Make a dynamic message template

Paste the copied Google Chat webhook URL in the text input box and type your personalized message body.

You can use dynamic fields, enclosed in double curly braces, in the message body. For instance, if name, age and city of members are listed in your Google Sheet, you can personalize the chat messages with variables.

Google Chat Configuration

Advanced users may use Scriptlets to add conditional text in the chat body.

{% if {{Age}} > 18 or {{Age}} == 18 %}
{{Name}} can vote in the elections
{% endif %}

Activate Google Chat Workflow

Click the Preview button and you should see the message posted to your Google Chat room. Document Studio will take the data from the second row of the selected Google Sheet and publish the message to your selected room. Click Done to locally apply your changes.

If you want the workflow to be automatically triggered every hour, so that any new rows added in that duration are processed automatically, you can choose the option Run workflow every hour and then click on the Save button.

The workflow will now appear in the workflow dashboard where you can edit, delete or manually run the workflow.