Mar 06, 2022 08:37 PM
Hello!
I’m absolutely stumped - I’ve set up a webhook that is based on a record entering into a specific view.
To obtain the recordID - I have created a formula field named ‘recordID’ and have set the script up based on the following code:
let url = "https://hook.eu1.make.com/vpkstrk2sh7pyune55of9cyoaleakk1p?recordID=";
let inputConfig = input.config();
await fetch(url + inputConfig['recordID']);
I have also set up my input variable to be based on the recordID field, however when I run this in integromat I’m getting a ‘NOT_FOUND’ error and it looks like its because the recordID is ‘undefined’.
Any help would be greatly appreciated as I’m pulling my hair out!
Mar 07, 2022 12:11 AM
Hi @Harry_McDonald - can you give some wider context on your set up here? When a record in Airtable enters a view you want thw automation to run and POST
data to this webhook? Is that right?
Mar 07, 2022 01:22 PM
Hi Jonathan - thanks for your response.
I have records that enter a specific view when they’re first created (simply a 1 x field filter). I have then set up an automation to trigger when records enter this view.
The automation is to run a script (shown in the above screenshot) and then In integromat I’ve set up a webhook function which is connected but is pulling the error listed above.
I’m stumped - so any help would be appreciated?
Mar 09, 2022 03:29 PM
@Harry_McDonald - If I understand correctly, when the record enters the view you want to post the record data (or some elements of the record data) to Integromat. If so you want to do something more like this:
let inputConfig = input.config()
// extract a data element from the record, e.g. the name field
let name = inputConfig.name
console.log(name)
// turn the extract fields into a data object
let data = {
name: name
}
// get your Integromat webhook URL
let url = 'https://hook.integromat.com/58eu44cck86kctw9ei5s8osg5a6b4er7j'
// then do a POST request to the url, passing the data in the body
const response = await fetch(url, {
method: 'POST',
body: JSON.stringify(data)
})
When Integromat receives this data via the inbound webhook it can pass the data to the next module in your automation, e.g. another app.
Mar 13, 2022 01:49 PM
Hi Jonathan,
Thanks for the response.
I ended up using the below syntax and it seems to have solved the problem without having to change anything else.
let inputConfig = input.config();
let recordID = inputConfig.recordID;
console.log(recordID);
let url=“https://hook.eu1.make.com/vpkstrk2sh7pyune55of9cyoaleakk1p”
console.log(url);
let request= url.concat(’?recordID=’,recordID)
console.log(request);
await fetch(request);