Why won't this script work when triggered by a button?

186 0
Showing results for 
Search instead for 
Did you mean: 
5 - Automation Enthusiast
5 - Automation Enthusiast

I want to send a webhook when a button is pressed on a record :

// Use recordAsync to get the record associated with the button
let record = await input.recordAsync();

// Check if the record exists
if (record) {
// Construct the URL based on the fetched record ID
let url = `${}`;

// Fetch data from the constructed URL
await fetch(url);
} else {
console.error("Record not found");

but I'm getting this error:


TypeError: Invalid arguments passed to input.record(label, source, options): • label should be a string, not undefined • source → source should be a Table, not undefined or source should be a View, not undefined or source should be a RecordQueryResult, not undefined or source should be an array, not undefined
    at main on line 2

Can anyone help here please? (I don't know scripting)

0 Replies 0