Only send Web hook to Zapier IF field is TRUE!

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.

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")
}