Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Only send Web hook to Zapier IF field is TRUE!

Topic Labels: Scripting extentions
177 1
cancel
Showing results for 
Search instead for 
Did you mean: 

I need a script that will run when I push a button that will check to see if a field is “TRUE” or checked and if it is, than will send the webhook out with the recordID. This will help our workflow because we want to make sure that all needed fields for a Zapier automation are present before a webhook is sent.

1 Reply 1

the basic idea would be something like this

let table = base.getTable("Table Name")

let record = await input.recordAsync("Select a record", table)

if(record && record.getCellValue("Checkbox Field") === true) {
    let url = "insert webhook url here";
    await fetch(url + "?recordID=" + record.id);
    output.markdown(`## Record sent to Zapier`)
} else {
    console.error("record not selected or value is not true")
}