# ↗️ Webhook Action Tutorial

**URL:** <https://community.glideapps.com/t/webhook-action-tutorial/20905>\
**Category:** Community Resources\
**Tags:** tutorial\
**Created:** [January 8, 2021, 8:09pm UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905 "2021-01-08T20:09:29Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/96552_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 24, 2021, 7:03am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/101 "2021-02-24T07:03:21Z")

</div>

Okay, so if I’m understanding correctly, what you need to do is send the values of several new rows as a parameter (or series of parameters) to your webhook, yes?

What about if you were to generate a Joined List column and use that?  
With a joined list, you can reference columns in any table, so getting at the data you need shouldn’t be a problem. If it needs to be filtered, then you could create template columns in each of the source and target tables, create a relation using those two template columns, and then build your joined list through that relation.

Would that work for you?

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [February 24, 2021, 9:40pm UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/102 "2021-02-24T21:40:58Z")

</div>

Hey Manan, I found a way to trigger script from webhook action.  
It’s by Deploying it as a web app.

Let’s have a look at the code of the WhatsApp Message trigger.  
  
  
`
function doGet(e) {`

`
```
return ContentService.createTextOutput("This is a GET Request!");

```
}
function doPost(e) {
```
var body = JSON.parse(e.postData.contents);
Logger.log(body);
var name = body["params"]["Name"]["value"];
var message1 = body["params"]["Message"]["value"];
var number = body["params"]["Number"]["value"];

var payload = {
    "username": "YOUR_USERNAME",
    "password": "YOUR_PASSWORD",
    "receiverMobileNo": number,
    "receiverName": name,
    "message": message1,
    // "message": message2,
    // "filePathUrl":image,
}

var options = {
    'method': 'post',
    'payload': payload
    // 'contentType': 'multipart/form-data',
};
var url = "https://app.messageautosender.com/message/new";
var response = UrlFetchApp.fetch(url, options);

```
`

`}
`  
After Saving this file, click on **Deploy** (Blue Button on right side of the script window)  
Then, Add deployment as a web app,  
Change Access to anyone, and tap deploy.  
Copy URL and paste it to Webhook Action on Glide.  
That means It’ll trigger this web app URL when clicked.

**Important** : You’ve to deploy every time when you change the code snippets.

Paste any kinda function to doPost() function, you can trigger that from the glide app.

---

<div class="post-metadata">

**Author:** ![mcclurefaith](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@mcclurefaith](https://community.glideapps.com/u/mcclurefaith)\
**Post date:** [February 25, 2021, 12:19am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/103 "2021-02-25T00:19:24Z")

</div>

Yes, thank you! The joined list was the key.

I’m not sure if I’ve implemented the sequence in Zapier in the most efficient way, but it’s working! The sequence: add a new item from a form in the app, custom action adds three events (rows) to the calendar sheet, then triggers the webhook with the value set to the joined list of all three events. Then in Zapier, split text action to split the joined list into three items, split text action to split the first item, create google calendar detailed event, split text action to split the second item, create google calendar detailed event, split action to split the third item, create google calendar detailed event. (It seems like I should be able to tell Zapier in one action to create a google event for each item, but I couldn’t figure out how to do that).

Btw, I wasn’t able to create a new webhook in the custom actions editor. I made a button on a hidden tab and configured the webhook there, then was able to select the webhook in my custom action. Not sure what I was doing wrong there.

Thank you again for your help.

---

<div class="post-metadata">

**Author:** ![Wiz.Wazeer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wiz.wazeer/32/72423_2.png) [@Wiz.Wazeer](https://community.glideapps.com/u/Wiz.Wazeer)\
**Post date:** [February 25, 2021, 1:10am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/104 "2021-02-25T01:10:29Z")

</div>

Really cool 🕶 now this is worth playing with.

---

<div class="post-metadata">

**Author:** ![Manan\_Mehta](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manan_mehta/32/13957_2.png) [@Manan\_Mehta](https://community.glideapps.com/u/Manan_Mehta)\
**Post date:** [February 25, 2021, 2:44am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/105 "2021-02-25T02:44:28Z")

</div>

Wow this changes the game for many of my apps!  
Thanks for this.

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [February 25, 2021, 3:26am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/106 "2021-02-25T03:26:59Z")

</div>

Also, this method looks a like cost effective. Even Rapid too.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/96552_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 25, 2021, 4:44am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/107 "2021-02-25T04:44:55Z")

</div>

> [@mcclurefaith](#):
>
> Btw, I wasn’t able to create a new webhook in the custom actions editor. I made a button on a hidden tab and configured the webhook there, then was able to select the webhook in my custom action. Not sure what I was doing wrong there.

Yeah, that’s a [known issue](https://community.glideapps.com/t/webhook-creation-and-excecution/21579)

Glad you got it working 👍

---

<div class="post-metadata">

**Author:** ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)\
**Post date:** [March 1, 2021, 10:31am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/108 "2021-03-01T10:31:49Z")

</div>

I am following the original video steps - and Google introduced new steps in the process to connect with Integromat. The process to set this up for a gmail account is relatively straightforward, well(enough) documented, and is available here - [Connecting Integromat To Google Services Using a Custom OAuth Client – Integromat Support](https://support.integromat.com/hc/en-us/articles/360013972700-Connecting-Integromat-To-Google-Services-Using-a-Custom-OAuth-Client) (it worked for me - a short 10 min detour as I follow @Robert_Petitto 's original video very slowly)

---

<div class="post-metadata">

**Author:** ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)\
**Post date:** [March 24, 2021, 8:01am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/109 "2021-03-24T08:01:25Z")

</div>

@Purvang_Joshi, I use few third party add-on in my Google sheet. Is there any way by which I can trigger it based on webhook?  
Currently it has time-trigger and google form submit trigger.

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [March 24, 2021, 9:58am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/110 "2021-03-24T09:58:45Z")

</div>

Yes. You can call that third-party function to your doPost() code.

Just call a function like apipheny(“Strings”) in code.

I haven’t tested it yet, let me know if you achieve it.

---

<div class="post-metadata">

**Author:** ![PabloMFalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pablomfalero/32/31166_2.png) [@PabloMFalero](https://community.glideapps.com/u/PabloMFalero)\
**Post date:** [March 24, 2021, 10:07am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/111 "2021-03-24T10:07:13Z")

</div>

You can use [Calndr](https://calndr.link/api-docs) and forget about webhooks, just add a button that says add to calendar linked to the calndr link

---

<div class="post-metadata">

**Author:** ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)\
**Post date:** [March 24, 2021, 2:14pm UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/112 "2021-03-24T14:14:13Z")

</div>

I am sorry but I have no idea about google scripts. Almost a zero knowledge in Appscripts and coding. Would be grateful if you can help me with it.  
Also, I do not have any additional code in my sheet except that of Add-on.

Just FYI, I am using “Autocrat”, Document Studio etc. add-ons in my google sheets.

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [March 24, 2021, 2:40pm UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/113 "2021-03-24T14:40:36Z")

</div>

Its okay. I’ll work out on this and let you know soon.

---

<div class="post-metadata">

**Author:** ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)\
**Post date:** [March 24, 2021, 2:42pm UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/114 "2021-03-24T14:42:05Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [March 24, 2021, 2:48pm UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/115 "2021-03-24T14:48:49Z")

</div>

hello here is a prototype script for managing the Webhook  
in google script use the web application deloyment.  
It’s an example.  
Replace the EventName and Pdf parameters with your own parameters

```
function doPost(request) {

  / ******************************************
   * WebHook, Column API
   * ****************************************
   *  
   * Call WebHook : 
   * https://script.google.com/macros/s/ {id} /exec
   * 
   * Call Column API :
   * no 
   * 
   */

  var jsonContents = JSON.parse(request.postData.contents);

  // Glide Header
  var appID = jsonContents["appID"];
  var timestamp = jsonContents["timestamp"];
  var idempotencyKey = jsonContents["idempotencyKey"];
  var hookKind = jsonContents["hookKind"];
  var params = jsonContents["params"];

  // Commun Webhook & Column API
  if (( appID == null || appID == " ") ||
      ( hookKind == null || hookKind == " ")) {
   
    // error
    // TODO return error
  }

  // Glide Parameters
  var glideParams = JSON.stringify(params);
  glideParams = JSON.parse(glideParams);
  
  // Log
  var ss = SpreadsheetApp.getActiveSpreadsheet(); 
  var sheetLog = ss.getSheetByName('Log');
  sheetLog.appendRow([new Date(),hookKind,timestamp,params,idempotencyKey,appID, JSON.stringify(request)]);

  // Process Values
  // --------------
  
  // Glide Value
  // si la valeur dans glide est empty, le parametre n'est pas inclus
  try {
    var eventname = glideParams["EventName"]["value"];
  }
  catch (e) {
    var eventname = "";
  }

  try {
    var pdf = glideParams["Pdf"]["value"];
  }
  catch (e) {
    var pdf = "";
  }
  
  // Endpoint 
  if (hookKind == "api-column")
  {
      // TODO Column API return params type:string, value:xxxx
  };
  
  return; 
 
}
```

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [March 24, 2021, 5:55pm UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/116 "2021-03-24T17:55:46Z")

</div>

Hey, How to return value to the API Column?  
Can you give an example?

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [March 24, 2021, 5:59pm UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/117 "2021-03-24T17:59:07Z")

</div>

Hi,  
I don’t have a solution for API column return values ​​yet.  
I’m waiting for an official version to do a real test.

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [March 24, 2021, 6:09pm UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/118 "2021-03-24T18:09:36Z")

</div>

I haven’t found a way to call a function to autocrat or document studio from webhook action. There isn’t any option or any document mentioned on their docs.

Btw I’m using apps script and webhook action to alternate autocrat. I’ll share the script for sure.

---

<div class="post-metadata">

**Author:** ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)\
**Post date:** [March 25, 2021, 9:40am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/119 "2021-03-25T09:40:12Z")

</div>

Thank you Purvang for your time.

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [March 25, 2021, 9:48am UTC](https://community.glideapps.com/t/webhook-action-tutorial/20905/120 "2021-03-25T09:48:53Z")

</div>

sorry @Purvang_Joshi  
I haven’t seen your script, I posted something very similar.

[Previous page](https://community.glideapps.com/t/webhook-action-tutorial/20905.md?page=5)

[Next page](https://community.glideapps.com/t/webhook-action-tutorial/20905.md?page=7)
