Jan 29, 2021 11:58 AM
Hello all,
I’m a no-code programmer (if that’s even possible) so for everything I do I look for a similar example and I copy and adapt.
I’m trying to make a script where after pressing a button the user is asked for a couple of values to be updated in that record. I’m not able to find any script example where it automatically selects the record which button was pressed, and I always see something like this:
const record = await input.recordAsync(“Pick a record”, table);
Where user has to find and choose again the record to be updated.
How can I do that? Is it possible?
Thank you!!!
Angel
Solved! Go to Solution.
Jan 30, 2021 12:44 AM
Hi @Angel_Baena - there’s two places you can run a script from - the script panel in the scripting app and via a script button on the record:
If the script has a record input line, e.g.:
let record = await input.recordAsync('Please select a order', orders);
then if you run the script from the scripting app, you will be prompted to find and select a record.
However, if you run the script by clicking on the script button for a specific record, the chosen record will be passed through to the script without any further find/select. You don’t need to change the script in any way to allow this - just something built into Airtable when using await input.record
Jan 30, 2021 12:44 AM
Hi @Angel_Baena - there’s two places you can run a script from - the script panel in the scripting app and via a script button on the record:
If the script has a record input line, e.g.:
let record = await input.recordAsync('Please select a order', orders);
then if you run the script from the scripting app, you will be prompted to find and select a record.
However, if you run the script by clicking on the script button for a specific record, the chosen record will be passed through to the script without any further find/select. You don’t need to change the script in any way to allow this - just something built into Airtable when using await input.record