TechBuzzPro

Integrate Slack with Google Forms: Step-by-Step Guide

· 4 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can integrate Slack with Google Forms using Google Apps Script or third-party automation tools like Zapier or Make (formerly Integromat). This integration sends new Google Form responses directly to a Slack channel, enabling real-time notifications for teams. Before starting, ensure you have access to both a Google account with Google Forms and a Slack workspace where you can manage apps and post messages.

What You'll Need

  • A Google account with access to Google Forms
  • A Slack workspace where you can install apps and create incoming webhooks
  • Owner or admin permissions in the Slack workspace to add integrations
  • Basic familiarity with Google Apps Script or a third-party automation tool (Zapier or Make)
  • The URL of a Slack incoming webhook (generated in Slack settings)
  • The Google Form you want to connect

Step-by-Step

  1. Open your Google Form in Google Forms. Click on the Responses tab at the top, then click the Google Sheets icon to create a new spreadsheet to collect responses. If a spreadsheet already exists, open it.
  2. In the linked Google Sheet, click Extensions > Apps Script. This opens the Apps Script editor in a new tab.
  3. Delete any default code in the script editor and paste the following script:
    function onSubmit(e) {
      const webhookUrl = 'YOUR_SLACK_WEBHOOK_URL';
      const sheet = e.source.getActiveSheet();
      const headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
      const row = e.range.getRow();
      const values = sheet.getRange(row, 1, 1, sheet.getLastColumn()).getValues()[0];
    
      let message = '*New Form Submission:*
    ';
      for (let i = 0; i < headers.length; i++) {
        message += `*${headers[i]}:* ${values[i]}\n`;
      }
    
      const payload = {
        text: message
      };
    
      const options = {
        method: 'post',
        contentType: 'application/json',
        payload: JSON.stringify(payload)
      };
    
      UrlFetchApp.fetch(webhookUrl, options);
    }
    
  4. Replace 'YOUR_SLACK_WEBHOOK_URL' with the actual webhook URL from your Slack workspace. Keep the quotes.
  5. In Slack, go to Settings & Administration > Manage Apps. Search for "Incoming Webhooks" and install it. Configure a new webhook by selecting the channel where messages should appear and copying the generated Webhook URL.
  6. Back in Apps Script, click Save Project. Give it a name like "Slack Form Notifier".
  7. Click the clock icon (Triggers) on the left sidebar. Click + Add Trigger at the bottom right.
  8. Set the following options:
    • Choose which function to run: onSubmit
    • Choose which deployment should run: Head
    • Select event source: From spreadsheet
    • Select event type: On form submit
  9. Click Save. You may be prompted to authorize the script. Follow the prompts to allow Google Sheets to send data via Apps Script.
  10. Test the integration by submitting a test response through your Google Form. Check the Slack channel—you should see a formatted message with the submission details.

Common Mistakes

  • Forgetting to replace the placeholder webhook URL in the script, causing silent failures.
  • Using the wrong event trigger—selecting "On edit" instead of "On form submit" means messages send for every spreadsheet edit, not just new form entries.
  • Pasting the script into the wrong Google Sheet—always use the one linked to the form.
  • Not granting permissions when prompted, which stops the script from running.
  • Installing the webhook in Slack but not selecting a channel, which results in no messages being posted.

Tips

  • Use Slack's formatting (like * for bold) to make messages more readable.
  • Include a timestamp in the message by adding *Timestamp:* ${e.values[0]}\n in the loop (since the first value is usually the timestamp).
  • For multiple forms, create separate webhooks or use conditional logic in the script to route messages.
  • Use Zapier as an alternative if you prefer a no-code solution—create a Zap with "New Google Form Response" as the trigger and "Send Channel Message" in Slack as the action.
  • Test with a single field first to confirm the flow before expanding.

Troubleshooting

If the Slack message doesn’t appear:

  • Check that the form is linked to the correct Google Sheet. Go to the Responses tab and ensure the green Sheets icon is active.
  • Verify the webhook URL is correct and copied exactly, including https://.
  • Ensure the script trigger is set to "On form submit" and not another event.
  • Look at the Apps Script execution log (under Executions tab) for error messages like 404 (bad URL) or 400 (malformed payload).
  • Confirm the Slack app has permission to post to the selected channel. Try reinstalling the webhook if needed.
  • Temporarily disable ad blockers or network filters that might block outgoing scripts.
  • If using Zapier, ensure both Google and Slack connections are active and re-authenticate if necessary.

Frequently Asked Questions

Can I send form responses to multiple Slack channels?

Yes. Use multiple webhooks in your script, each targeting a different channel, or set up separate Zaps in Zapier for each destination.

Do I need to pay for this integration?

No. Google Apps Script and Slack incoming webhooks are free. Zapier offers a free tier with limited tasks per month.

Will this work with existing form responses?

No. The integration only triggers for new submissions after setup. Backfill manually if needed.

Can I customize the message format in Slack?

Yes. Edit the message variable in the script to include emojis, change formatting, or omit certain fields.

Is this secure? Can others access my webhook URL?

The webhook URL is secret—anyone with it can post to your Slack channel. Do not share it publicly or commit it to code repositories.

What if I don’t see the Apps Script option in Extensions?

Ensure you're using a desktop browser and signed into a Google account with access to Google Sheets. The option may not appear in mobile apps or restricted accounts.