How to Mention Someone in a Slack Message from Google Forms

Learn how to send messages to Slack from Google Form and Google Sheet. You can also tag or mention a Slack user in the chat message.

This video tutorial explains how you can automatically send Slack messages from Google Forms with the help of Document Studio.

For this example, we have an event registration form created with Google Forms. When a participant completes the form and clicks the submit button, a message is instantly posted in the company’s Slack channel with details of the attendee like their name and email address.

The Google Form has a “Preferred Location” question as well and based on this answer, a specific member of the team will be tagged or mentioned in the Slack message. For instance, if the attended selects New York as the location in the form, the internal Slack message will tag @Angus since they takes care of New York registrations.

Google Forms for Slack Message

Send Slack Messages on Google Form Submit

Go to your Google Form and launch Document Studio. Create a new workflow and add a Slack task.

Connect your Google Account to your Slack account and you’ll be presented with a list of #channels available in the Slack workspace that you have linked with your account.

Select the relevant Slack channel where you wish to post messages and specify the message template that will be sent to Slack on new form submissions.

Slack Mentions Logic

The template message includes variables like {{ Attendee Name }} which will be replaced with the values from the form submission. It also includes a scriptlet to add conditional content in the Slack message.

The Scriptlet looks at the Location entered in the Google Form and, based on the answer, a specific user gets tagged in the Slack message. You can learn more about the syntax of Scriptlets here.

🎉 {{Attendee Name}} would attend the event from {{Location}}

{% assign answer = "{{ Location }}" %}
{% if answer == "New York" %}
  <@U08N2HAQTF9>
{% elsif answer == "Boston" %}
  <@U05N6HAQZM1>
{% else %}
  <@U09PX8AQLJ1>
{% endif %}

How to @Mention a Slack User

Slack assigns a unique ID to each account and we put this ID in the Slack message to mention / tag that user in the message.

To obtain the User ID of a Slack account, follow these steps:

  1. Open slack.com, navigate to your Slack channel and find any @mention of the user you’re interested in.
  2. Right-click the @mention, and from the contextual menu, select “Copy link.”

The user link you’ve copied will have the following format:

labnol.slack.com/team/U05N6HAQZM1

In this link, the portion starting with U… represents the User ID of the Slack user.

If you want to @mention this user in your Slack message, enclose the User ID inside angle brackets and prefix it with the @ symbol, like this:

How are you <@UABC123> 🎉

Find Slack User ID

Amit Agarwal

Amit Agarwal

Google Developer Expert, Google Cloud Champion

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.

Amit has developed several popular Google add-ons including Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Awards & Titles

Digital Inspiration has won several awards since it's launch in 2004.

Google Developer Expert

Google Developer Expert

Google awarded us the Google Developer Expert award recogizing our work in Google Workspace.

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards in 2017.

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional (MVP) title for 5 years in a row.

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator title recognizing our technical skill and expertise.

Email Newsletter

Sign up for our email newsletter to stay up to date.

We will never send any spam emails. Promise.