Help

Selecting a record after pressing button

Topic Labels: Scripting extentions
Solved
Jump to Solution
1604 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Angel_Baena
6 - Interface Innovator
6 - Interface Innovator

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

1 Solution

Accepted Solutions
JonathanBowen
13 - Mars
13 - Mars

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:

Screenshot 2021-01-30 at 08.37.48

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

See Solution in Thread

1 Reply 1
JonathanBowen
13 - Mars
13 - Mars

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:

Screenshot 2021-01-30 at 08.37.48

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