DEV Community

Cover image for Discord notifications on Google form submission
Kushal S T
Kushal S T

Posted on

Discord notifications on Google form submission

Step #1

Get discord webhook. will help you understand how to get a webhook for your channel in Discord.

Step #2

Go to the Google form with which you want to integrate Discord. Click on the 3 dot menu on the top right and then click on Script EditorScreenshot 2021-04-03 at 8.14.42 PM

Step #3



  function onSubmit(e) {
  var discordPayload = {
    content: "New Form Submitted",
    embeds: [
        type: "rich",
        title: "Form Entry",
        color: 307506,
        fields: []

  e.response.getItemResponses().forEach(function (i) {
    var v = i.getResponse() || "None";

    if (!Array.isArray(v))
        name: i.getItem().getTitle(),
        value: v
        name: i.getItem().getTitle(),
        value: v.toString()

  UrlFetchApp.fetch(POST_URL, {
    method: "post",
    payload: JSON.stringify(discordPayload),
    contentType: "application/json"

Enter fullscreen mode Exit fullscreen mode

Step #4

Click on Edit -> Current project's triggers in Script Editor.
Screenshot 2021-04-03 at 8.19.01 PM

Step #5

Create a new trigger for onSubmit event
Screenshot 2021-04-03 at 8.23.25 PM

Step #6

There is no step 6! Go ahead and submit the form and test it. you'll see something like this in your Discord channel 👾 👾 👾
Screenshot 2021-04-03 at 8.37.59 PM

Top comments (4)

theindianappguy profile image
Sanskar Tiwari

For people who do not want to code use

samy_abdous_6f2af81becffe profile image
Samy Abdous

Do you know how to assign each section to a webhooks please?

depictukinetic profile image

I'd like this information too!

wolffivem profile image

it says this

6:24:19 PM Error TypeError: Cannot read property 'response' of undefined
onSubmit @