Google Form Webhook

Google Form Webhook Script:

function onFormSubmit(e) {

 var data = {

   “id”: e.source.getId(),

   “title”: e.source.getTitle() ? e.source.getTitle() : “Please fill the form”,

   “is_private”: e.source.requiresLogin(),

   “is_published”: e.source.isAcceptingResponses(),

   “id”: e.response.getId(),

   “timestamp”: e.response.getTimestamp(),

   “fileds”: e.response.getItemResponses().map(function(y) {

    return {

     h: y.getItem().getTitle(),

     k: y.getResponse()

    }

   }, this).reduce(function(r, y) {

    r[y.h] = y.k;

    return r

   }, {})

 };

 var options = {

  method: “post”,

  payload: JSON.stringify(data, null, 2),

  contentType: “application/json; charset=utf-8”,

 };

 UrlFetchApp.fetch(“https://hook.integromat.com/mug45xs7ttn83q27qelhd4t8pwpo9z6”, options);

};