Jun 08, 2020 05:26 PM
Update (June 25, 2020): The button field is now available for all users — read more in our launch blog post: https://blog.airtable.com/now-available-button-field
:wave: Hey all — I’d like to announce the public beta of button field, a new field type that allows you to create buttons that trigger customizable actions. These actions include:
Perhaps most relevant to this community — you can use this new field type to run scripts directly from grid view, kanban view, gallery view, and expanded records. This will make scripts more readily accessible to end users and seamlessly integrated with their existing workflows. You can also customize your buttons with helpful labels that describe what your scripts do.
When a script is run from a button, the first input.recordAsync
call in the script will use the record the button was clicked from. As an example:
// Change these to match your base.
let table = base.getTable('Table name');
let field = table.getField('Field name');
// When run from a button field, the script skips the prompt
// and automatically uses the button's record.
let record = await input.recordAsync('Choose a record', table);
let cellValue = record.getCellValue(field);
output.markdown(`# You have selected ${value}.`);
Jun 08, 2020 05:30 PM
This is an awesome addition to Airtable! :slightly_smiling_face:
Jun 09, 2020 07:11 AM
Wow I can’t wait to use this.
Jun 09, 2020 08:13 AM
Wow ! Here’s june’s gift ?
That’s the way I like Airtable !
Thanks to @Kasra Dev Team, thanks to @Stephen_Suen !
oLπ
Jun 09, 2020 08:30 AM
Thank you for this new ability to run a script for a specific record when looking at the record! This is awesome functionality and will make many workflows much easier.
The ability to open a specific record in Page Designer is quite nice as well.
It’s great to see all the new things that a button can do. If you ever want to solicit ideas for other button actions, let us know. I’m sure the community has lots of ideas.
Jun 09, 2020 08:50 AM
@Stephen_Suen I’m sure you’ve heard enough about my thoughts on Buttons…
But the last thing I’ll suggest is zooming to a record in the Map Block.
Jun 09, 2020 09:57 AM
We’d love to hear your ideas! Please leave any feedback/suggestions via this form: https://airtable.com/shr78fy7G3400LC9D
Jun 09, 2020 10:31 PM
Will it be possible to implement the button in forms in order to run the script in the background?
Jun 10, 2020 08:52 AM
It’s not possible right now - I’ve already tried it (not with a form, but with a public facing shared view). If the button is configured to launch a link, then it works - you can give people pretty buttons to click for links. But if the button is configured to trigger a script, they are disabled in public facing shares.
It’s a bummer, but I get why they did it - if it’s being triggered from a public facing shared view, there’s no guarantee that there’s an instance of the parent base running to receive the script call and process it. Plus, scripts rely on a user session when they run, and people using a shared view or form don’t have a session with Airtable.
Jun 10, 2020 08:54 AM
As @Jeremy_Oglesby mentioned this isn’t possible right now, but I’d love to hear what you’re hoping to do with buttons inside forms.