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:
- Opening a link based on a URL formula
- Opening a specific record in page designer
- Opening an embed in the URL preview block
- Sending emails with SendGrid
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}.`);