Passing data an Integromat Webhook

Hi,

Please could someone help me with this?

I found this:

$(document).on('knack-form-submit.view_497', function(event, view, data) {

commandURL = "https://hook.integromat.com/xxxxxxxxxxxxxxxxxxxxx?recordid=" + data.id;

});

and just want to pass the object id to integromat on form submission but when I run the webhook in integromat to catch the data structure nothing comes through.

Can anyone tell me where I have gone wrong with this please?

Thank you

 

Paul

 

$(document).on('knack-form-submit.view_xx', function(event, view, record) { //change  xx to your view
 var url = 'https://hook.integromat.com/id'; //change to your hook
 //{{1.recordId}}   

/*use this in your integromat scenario before you have run it -the bubble will not exist for selection until after you've run it at least once but you can paste this in the next module to look up the record. */


 //console.log('sending data to integromat https://hook.integromat.com/id'); //for bug testing
 var data = {
   recordId: record.id,

source: "enter your scene number for backtracking"

 };

 Knack.showSpinner();
 // Make the AJAX call
 $.ajax({
   url: url,
   type: 'POST',
   data: data,
 }).done(function(responseData) {
   console.log('sent record ID');
   Knack.hideSpinner();
 });
});

Let me know if Craigs response doesn't fix your issue.

Hi, I'm no expert (just learnt how to do this myself ...).

This is the full code I used:

 

$(document).on('knack-form-submit.view_624', function(event, view, data) {


setTimeout(function(){

Knack.showSpinner();

}, 2000);

commandURL = "https://hook.integromat.com/yieoat0tl8jlue4tu1i917e7xxxxxx?recordid=" + data.id ;


$.get(commandURL, function(data, status){


Knack.hideSpinner();

$(".kn-message.success").html("<b>" + data + "</b>");

});

});

 

Make sure:

  • the webhook url is correct from integromat, and pasted into the JS code in Knack
  • your form view is correct for the form you are submitting, and then submit the form in Knack to send the data for the webhook
  • you can use the last line to send a message from Integromat back to Knack from a webhook "response" module at the very end of the scenario

Craig