Aug 04, 2022 08:55 AM
I want to use an API to trigger Zapier as waiting for a record to enter a view might sometimes take too long for a near real-time sync operation. So I want to pass the record id of the record that needs to be processed by Zapier.
I have no script code experience but I should be able to understand the code from how to get the incoming parameter and pass this to the webhook code. And same for the webhook URL.
Thanks for your help.
Aug 04, 2022 11:01 AM
Hi @Jaco
Add a formula field and input: Record_ID() to see the id for each record.
If you are connecting to the Airtable API you can GET the ID: REST API - Airtable
If you are using Airtable scripting:
let table = base.getTable("My Table");
let queryResult = await table.selectRecordsAsync({fields: []});
let record = queryResult.records[0];
output.text(record.id);
Aug 04, 2022 12:10 PM
Welcome to the community, @Jaco!
You can always just use a button field for this. Just attach the URL (with the Record ID appended) into an “Open URL” button field, and then click on the button to trigger your webhook.
Your formula would look something like this:
"https://example.com?RecordID=" & RECORD_ID()
Alternatively, you can do this with a script in an automation… it would look something like the screenshot below:
And here is the code from that screenshot:
let config = input.config();
let url = `https://example.com?RecordID=${config.myRecord}`;
fetch(url);
p.s. Zapier has a lot of limitations compared to Make.com. One of the limitations is that Zapier doesn’t give the ability for you to set a custom webhook response, whereas Make.com does allow custom webhook responses. This is one of the many (many) reasons that I prefer Make over Zapier.
Aug 10, 2022 10:47 PM
Aug 11, 2022 04:05 AM
@Jaco You’re welcome! Yeah, the more you play with Make.com, the more you realize that it can do hundreds (possibly thousands?) of things that Zapier can only dream of doing.
It’s a very empowering platform! :grinning:
The only real downside is that their help documentation is very weak, so a lot of the product discovery has to come through your own personal experimentation.