Hi all,
I’d like to know if there is a way in a Scripting app to check if the script was called from the click of a button in a column or via the Run button on the Script app itself.
My use case is that we ideally want one script that can be used either for a single record (the button column scenario) or an array of records (which we would fetch & manage in the script itself).
Basically the first if
statement in the script would check this, and then the code would branch accordingly. Sample code to demonstrate the idea:
let table = base.getTable('Orders');
if ('button was clicked') { // <-- How to make this check??
//process that row only
let record = await input.recordAsync('Pick record',table );
} else {
// process records from a table or view etc.
let records = await table.selectRecordsAsync();
}
Thanks in advance for any suggestions!