Skip to main content
Solved

Help with script to send Integromat webhook data

  • August 20, 2021
  • 7 replies
  • 88 views

Burner
Forum|alt.badge.img+15
  • Known Participant
  • 47 replies

Hi,

I’m new to Airtable scripting and am just learning my way around through hit & trial. I don’t have any javascript experience either, but I’ve used python in the past. I’m trying to write an Airtable script that sends data to my Integromat webhook trigger. So far I’ve been gotten the following:

// Webhook URL
let webhook = 'https://hook.integromat.com/integromaturl'; // replace with actual integromat URL

// Table to send data from
let tableName = 'Master Client';

// Fields to bind and send
let fieldsToSend = [
    'Client ID',
    'Client Name',
    'Email',
    'Created Time',
    'Last Modified'
]

I guess I’m stuck with what to do after this. My intent is to use the Airtable automation such that when a new record is created in this table (Master Client), I want this script to run.

But what do I need to add to my script so that Airtable sends the information in my ‘fieldsToSend’ variable to my ‘webhook’ variable. All I seem to have done in my script is to create and assign variables – it doesn’t really do anything.

Sorry if this is stupid and really basic, I’m literally just figuring this out from scratch.

Any help would be much appreciated.

Thank you.

Best answer by Joe_Hewes

Okay, but how do I do that? I want a script to trigger sending to a webhook instantly and not use the Integromat scheduled triggers.

So I’ll reduce the variable down to just the record ID, but what else do I need to put in the script to send a POST (I think that’s what it is) request?


If you are doing this as an automation you need to setup an input variable for the script using the airtable record ID that you want to send as the data - in this example i’ve called it “inputRecord” (this will vary depending on your approach, but it’s usually the record id from step one / the trigger of your automation).

Generate your webhook url in integromat and insert it into line 5 of the following code:

let inputConfig = input.config();
let recordID = inputConfig.inputRecord;
console.log(recordID);
let url="*integromat webhook url goes here*"
console.log(url);
let request= url.concat('?recordID=',recordID)
console.log(request);
await fetch(request);

Hope that helps!

7 replies

Forum|alt.badge.img+15
  • Inspiring
  • 69 replies
  • August 23, 2021

Don’t bother with all that - just send over the record Id and use integromat’s get record function to grab the actual data.


Burner
Forum|alt.badge.img+15
  • Author
  • Known Participant
  • 47 replies
  • August 23, 2021

Don’t bother with all that - just send over the record Id and use integromat’s get record function to grab the actual data.


Okay, but how do I do that? I want a script to trigger sending to a webhook instantly and not use the Integromat scheduled triggers.

So I’ll reduce the variable down to just the record ID, but what else do I need to put in the script to send a POST (I think that’s what it is) request?


Forum|alt.badge.img+15
  • Inspiring
  • 69 replies
  • Answer
  • August 26, 2021

Okay, but how do I do that? I want a script to trigger sending to a webhook instantly and not use the Integromat scheduled triggers.

So I’ll reduce the variable down to just the record ID, but what else do I need to put in the script to send a POST (I think that’s what it is) request?


If you are doing this as an automation you need to setup an input variable for the script using the airtable record ID that you want to send as the data - in this example i’ve called it “inputRecord” (this will vary depending on your approach, but it’s usually the record id from step one / the trigger of your automation).

Generate your webhook url in integromat and insert it into line 5 of the following code:

let inputConfig = input.config();
let recordID = inputConfig.inputRecord;
console.log(recordID);
let url="*integromat webhook url goes here*"
console.log(url);
let request= url.concat('?recordID=',recordID)
console.log(request);
await fetch(request);

Hope that helps!


Burner
Forum|alt.badge.img+15
  • Author
  • Known Participant
  • 47 replies
  • August 27, 2021

If you are doing this as an automation you need to setup an input variable for the script using the airtable record ID that you want to send as the data - in this example i’ve called it “inputRecord” (this will vary depending on your approach, but it’s usually the record id from step one / the trigger of your automation).

Generate your webhook url in integromat and insert it into line 5 of the following code:

let inputConfig = input.config();
let recordID = inputConfig.inputRecord;
console.log(recordID);
let url="*integromat webhook url goes here*"
console.log(url);
let request= url.concat('?recordID=',recordID)
console.log(request);
await fetch(request);

Hope that helps!


Thanks. I’ll try this out and let you know how it goes. Really appreciate it.


Burner
Forum|alt.badge.img+15
  • Author
  • Known Participant
  • 47 replies
  • August 27, 2021

If you are doing this as an automation you need to setup an input variable for the script using the airtable record ID that you want to send as the data - in this example i’ve called it “inputRecord” (this will vary depending on your approach, but it’s usually the record id from step one / the trigger of your automation).

Generate your webhook url in integromat and insert it into line 5 of the following code:

let inputConfig = input.config();
let recordID = inputConfig.inputRecord;
console.log(recordID);
let url="*integromat webhook url goes here*"
console.log(url);
let request= url.concat('?recordID=',recordID)
console.log(request);
await fetch(request);

Hope that helps!


Thank you. This worked perfectly.


Max_Bernstein
Forum|alt.badge.img+10
  • Known Participant
  • 16 replies
  • May 4, 2023

Don’t bother with all that - just send over the record Id and use integromat’s get record function to grab the actual data.


Hey Joe, what if all you need from the trigger record is the RecordID and one other single line text field? Wouldn’t it be more efficient to send both pieces of data in the webhook vs expending another operation on the Get Record module? 

Can you please show us how that second line of data can be written into the AT script?


dilipborad
Forum|alt.badge.img+23
  • Brainy
  • 235 replies
  • May 25, 2025

Ran into the same kind of learning curve with Airtable automations almost gave up until a break involving tea and some Amish Naturals Face Balm cleared my head.

Another spam content, Used a very great trick, content bit related to topic and then add promotion link.