---
title: "How to Send a Webhook from Google Forms (Apps Script)"
meta:
  "og:description": "Google Forms has no built-in webhooks, but a few lines of Apps Script and an on-form-submit trigger will POST every response to your URL. Copy-paste code."
  "og:title": "How to Send a Webhook from Google Forms (Apps Script)"
  description: "Google Forms has no built-in webhooks, but a few lines of Apps Script and an on-form-submit trigger will POST every response to your URL. Copy-paste code."
---

![Stripes](https://webhookrelay.com/blog/google-forms-webhook/images/stripes.svg)

# **How to Send a Webhook from Google Forms (Apps Script)**

Google Forms has no built-in webhooks, but a few lines of Apps Script and an on-form-submit trigger will POST every response to your URL. Copy-paste code.

Google Forms is great at collecting responses but has **no native webhooks** — there's no field where you paste a URL. The fix is a few lines of **Google Apps Script** that POST each response to your endpoint. This guide shows the correct, minimal setup, and avoids a step you'll see in other tutorials that you don't actually need. (New to webhooks? See [what is a webhook](https://webhookrelay.com/blog/google-forms-webhook/blog/what-is-webhook/).)

## [The approach](#the-approach)

Every Google Form can have a bound Apps Script. We'll:

1. Add a function that turns a submitted response into JSON and POSTs it with `UrlFetchApp`.
2. Wire it to an **installable "On form submit" trigger** so it runs on every submission.

That's it — **no "Deploy as web app"** step. (Deploying as a web app is for _receiving_ HTTP requests, not for sending one on submit; adding it here just exposes an endpoint you don't need.)

## [Step 1 — open the script editor](#step-1-open-the-script-editor)

In the form editor, click the **⋮ (three dots)** menu (top-right, near Send) → **Apps Script**. This opens a script bound to your form.

## [Step 2 — add the code](#step-2-add-the-code)

Replace the default contents with this, and set `ENDPOINT_URL` to your webhook URL:

```
const ENDPOINT_URL = 'https://your-endpoint.example.com/webhook';

function onFormSubmit(e) {
  const payload = {};
  // e.response is the FormResponse for THIS submission
  e.response.getItemResponses().forEach(function (item) {
    payload[item.getItem().getTitle()] = item.getResponse();
  });
  payload.submittedAt = e.response.getTimestamp();

  UrlFetchApp.fetch(ENDPOINT_URL, {
    method: 'post',
    contentType: 'application/json',
    payload: JSON.stringify(payload),
    muteHttpExceptions: true,
  });
}
```

Using the **event object `e.response`** is more reliable than fetching "the latest response" from the form — it's exactly the submission that fired the trigger, with no race conditions.

## [Step 3 — add an installable trigger](#step-3-add-an-installable-trigger)

This is the step that trips people up. Because `UrlFetchApp` needs authorization, a _simple_ trigger won't work — you need an **installable** one:

1. In the Apps Script editor, click the **Triggers** icon (the alarm clock) in the left sidebar.
2. **Add Trigger**.
3. Choose function **`onFormSubmit`**, event source **From form**, event type **On form submit**.
4. **Save**, then **authorize** the script when Google prompts (you'll approve the permissions once).

![The Apps Script Add Trigger dialog set to function onFormSubmit, event source &quot;From form&quot; and event type &quot;On form submit&quot;](https://webhookrelay.com/blog/google-forms-webhook/images/guides/google-forms-apps-script-trigger.png)

## [Step 4 — test it](#step-4-test-it)

First, capture what the form sends by pointing `ENDPOINT_URL` at a free [Webhook Bin](https://webhookrelay.com/blog/google-forms-webhook/webhook-bin/) — submit a test response and you'll see the exact JSON arrive. Then switch `ENDPOINT_URL` to your real handler.

## [Where the webhook goes next](#where-the-webhook-goes-next)

Once your form responses are flowing as webhooks, Webhook Relay can route them anywhere: [transform](https://webhookrelay.com/blog/google-forms-webhook/features/transform-webhooks/) each submission and [fan it out](https://webhookrelay.com/blog/google-forms-webhook/features/webhook-multiple-destinations/) to multiple destinations, or deliver to a service on your own machine.

- [Webhook to Google Sheets](https://webhookrelay.com/blog/google-forms-webhook/blog/webhook-to-google-sheets/) — log every submission to a sheet.
- [Webhook to Slack](https://webhookrelay.com/blog/google-forms-webhook/blog/webhook-to-slack/) or [Discord](https://webhookrelay.com/blog/google-forms-webhook/blog/webhook-to-discord/) — get notified on each response.
- [Receive it on localhost](https://webhookrelay.com/blog/google-forms-webhook/webhooks/) — drive a local handler with real submissions.

Ready to turn form submissions into webhooks? [Grab a free Webhook Bin](https://webhookrelay.com/blog/google-forms-webhook/webhook-bin/) to see your first one, or [start forwarding for free](https://my.webhookrelay.com/register).