# Creating a Webhooks Button to launch a Scenario

**URL:** <https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958>\
**Category:** Questions\
**Tags:** filters\
**Created:** [May 10, 2024, 9:35pm UTC](https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958 "2024-05-10T21:35:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stanislas\_Berteloot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/stanislas_berteloot/32/30520_2.png) [@Stanislas\_Berteloot](https://community.make.com/u/Stanislas_Berteloot)\
**Post date:** [May 10, 2024, 9:35pm UTC](https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958/1 "2024-05-10T21:35:19Z")

</div>

Hello

I am looking for a way to submit text and to run a Scenario after each submission

Google Forms or Slack could be the way. It seems that only enterprise level is needed for Slack app. So Google Form might be the way to go.

I have see a tutorial on how to create run a scenario from a custom button on a Google form but I didn’t get it to work.

Also I don’t know how to link this webhook to a form submission.

Ideally having an instant execution once a form is submitted would be the best…

Any ideas would be welcomed.

Stan

---

<div class="post-metadata">

**Author:** ![Bilal\_Mansouri](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/bilal_mansouri/32/34065_2.png) [@Bilal\_Mansouri](https://community.make.com/u/Bilal_Mansouri)\
**Post date:** [May 11, 2024, 12:26am UTC](https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958/2 "2024-05-11T00:26:46Z")

</div>

Hi Stan,

It sounds like you want to trigger a scenario execution whenever a form is submitted, and you’re considering using Google Forms

I’ll walk you through the process of setting up a Google Form that triggers a webhook whenever a user submits the form. We’ll use Google Apps Script to retrieve the form responses and send the submitted data to a specified webhook URL.

**Step 1: Create a Google Form**

1. Go to Google Forms ([https://forms.google.com/](https://forms.google.com/)) and create a new form.
2. Add fields for name and email, and any other fields you require.
3. Customize the form as needed (title, description, theme, etc.).

 ![Screenshot 2024-05-11 at 1.01.28 AM](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/e/3/e357978b0852e16618035068c13e79c7b172962a.jpeg)

**Step 2: Create a Google Apps Script**

1. Open your Google Form.
2. Click on the “More” menu (three dots) in the top-right corner and select “Script editor.”

 ![Screenshot 2024-05-11 at 1.02.19 AM](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/0/c/0cc8947ed8db24a82fe38c732d3025aef542b364.jpeg)

1. In the script editor, delete any existing code and replace it with the following:

```auto
function onFormSubmit(e) {
  var form = FormApp.getActiveForm();
  var formResponses = form.getResponses();
  var latestResponse = formResponses[formResponses.length - 1];
  var itemResponses = latestResponse.getItemResponses();
  
  // Extract the submitted name and email from the form response
  var submittedName = itemResponses[0].getResponse();
  var submittedEmail = itemResponses[1].getResponse();
  
  // Webhook URL
  var webhookUrl = "add-your-make-webhook-here";
  
  // Payload data
  var payload = {
    "name": submittedName,
    "email": submittedEmail
  };
  
  // Send the webhook request
  var options = {
    "method": "POST",
    "contentType": "application/json",
    "payload": JSON.stringify(payload)
  };
  
  UrlFetchApp.fetch(webhookUrl, options);
}

```

1. Replace the `webhookUrl` variable with your actual webhook URL.
2. Save the script by clicking on the “Save” button

 ![Screenshot 2024-05-11 at 1.04.53 AM](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/e/9/e92480bc446cef3f5527c5827d23725d0db090f9.jpeg)

**Step 3: Set up a Trigger**

1. In the script editor, click on the “Triggers” button (clock icon) in the left sidebar.

 ![Screenshot 2024-05-11 at 1.05.47 AM](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/4/5/4554222d5630354ad7cceb073ce8c88744ae4b5d.png)

1. Click on the “Add Trigger” button in the bottom-right corner.  

2. Configure the trigger as follows:

- Choose which function to run: **“onFormSubmit”**
- Choose which deployment should run: **“Head”**
- Select event source: **“From form”**
- Select event type: " **On form submit"**

1. Click on the “Save” button to create the trigger.

 ![Screenshot 2024-05-11 at 1.08.02 AM](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/9/0/902ab9d0cf680ef5e21239e2f2bf83c1adc1d8a7.jpeg)

**Step 4: Test the Setup**

1. Submit a response to your Google Form with a name and email.
2. Check your webhook endpoint to verify that it received the form submission data.

 ![Screenshot 2024-05-11 at 1.17.21 AM](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/3/8/38d0c6d742f8b3657ec278d6e748a821ee43416b.jpeg)

By following this step-by-step guide, you should now have a Google Form set up that triggers a webhook whenever a user submits the form.

The submitted name and email will be sent as a payload to the specified webhook URL. You can customize the form and the script to include additional fields and data as needed.

Hope that clears things up!

---

<div class="post-metadata">

**Author:** ![Stanislas\_Berteloot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/stanislas_berteloot/32/30520_2.png) [@Stanislas\_Berteloot](https://community.make.com/u/Stanislas_Berteloot)\
**Post date:** [May 11, 2024, 2:27am UTC](https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958/3 "2024-05-11T02:27:53Z")

</div>

Wow, thank you so much!  
I will try this in the morning and get back to you. It seems like this is exactly what I wanted to do.  
So grateful for your taking the time to walk me through.  
Thanks  
Stan

---

<div class="post-metadata">

**Author:** ![Mohammed\_Breky](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@Mohammed\_Breky](https://community.make.com/u/Mohammed_Breky)\
**Post date:** [May 11, 2024, 10:01am UTC](https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958/4 "2024-05-11T10:01:52Z")

</div>

if your form is simple, and you don’t want to get into googleforms, you can use an HTML page and host it on your server or any free hosting like github or 000webhost, ask Chat GPT to make you the HTML form with your required field and tell him to send the data to a webhook, then replace with your webhook url

worked for me before, and it gives you a more professional look if it’s for a client.

---

<div class="post-metadata">

**Author:** ![Donald\_Mitchell](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/donald_mitchell/32/8749_2.png) [@Donald\_Mitchell](https://community.make.com/u/Donald_Mitchell)\
**Post date:** [May 11, 2024, 2:02pm UTC](https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958/5 "2024-05-11T14:02:28Z")

</div>

If you’re not tied to Google Forms, something like Fillout, Jotform, as well as others have great integrations with Make. There’s a whole module for “When form is submitted” so it’s super easy to get up and running.

---

<div class="post-metadata">

**Author:** ![Stanislas\_Berteloot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/stanislas_berteloot/32/30520_2.png) [@Stanislas\_Berteloot](https://community.make.com/u/Stanislas_Berteloot)\
**Post date:** [May 12, 2024, 2:57am UTC](https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958/6 "2024-05-12T02:57:08Z")

</div>

Jotform is great and works perfectly.  
Thanks!

---

<div class="post-metadata">

**Author:** ![Stanislas\_Berteloot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/stanislas_berteloot/32/30520_2.png) [@Stanislas\_Berteloot](https://community.make.com/u/Stanislas_Berteloot)\
**Post date:** [May 12, 2024, 2:59am UTC](https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958/7 "2024-05-12T02:59:13Z")

</div>

First time I play with Github. Amazing thanks  
I have a page with a simple form now. it works but only triggers when I click on run once.  
I I live it live and set to immediately submitting a form doesn’t seem to trigger it.

here is the java script

document.getElementById(‘simpleForm’).addEventListener(‘submit’, function(event) {  
event.preventDefault(); // This line prevents the default form submission

```
const formData = {
    message: document.getElementById('message').value
};

fetch('https://hook.us1.make.com/pa9a2atty29md7kd3y5byva159r1xkxh', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    },
    body: JSON.stringify(formData)
})
.then(response => {
    if (!response.ok) {
        throw new Error('Network response was not ok');
    }
    return response.json();
})
.then(data => alert('Form submitted successfully!'))
.catch((error) => {
    console.error('Error:', error);
    alert('Failed to submit form');
});

```

});

---

<div class="post-metadata">

**Author:** ![Stanislas\_Berteloot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/stanislas_berteloot/32/30520_2.png) [@Stanislas\_Berteloot](https://community.make.com/u/Stanislas_Berteloot)\
**Post date:** [May 12, 2024, 2:59am UTC](https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958/8 "2024-05-12T02:59:47Z")

</div>

I also still have to try this.

---

<div class="post-metadata">

**Author:** ![Mohammed\_Breky](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@Mohammed\_Breky](https://community.make.com/u/Mohammed_Breky)\
**Post date:** [June 8, 2024, 5:36pm UTC](https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958/9 "2024-06-08T17:36:15Z")

</div>

i think now you can use the google form module, it has the watch response trigger

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [September 6, 2024, 5:51pm UTC](https://community.make.com/t/creating-a-webhooks-button-to-launch-a-scenario/36958/10 "2024-09-06T17:51:17Z")

</div>


