Help

Trigger Built-in Airtable automation with a button?

Topic Labels: Automations
Solved
Jump to Solution
5490 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Amaury_HALLE
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi community!
Is it possible to trigger a built-in Airtable automation (example: Create a custom automation) when a button is clicked?
Thanks!

1 Solution

Accepted Solutions
David_Solimini
6 - Interface Innovator
6 - Interface Innovator

You can use a button to trigger a script, as @kuovonne notes, and that script can flip a checkbox. THat change can trigger the automation (meets a condition).

Here’s a quick script I hacked toegther from various sources that does this:

let table = base.getTable("Pipeline"); //The name of the table you're in here
let record = await input.recordAsync('Pick a record', table);
if (record) {
   
 if (record.getCellValue("flipme")===true) {
    table.updateRecordAsync(record, {'flipme': false});
 } else { table.updateRecordAsync(record, {'flipme': true});}
output.text('Value flipped');
    
}

All this does is take the given record and change the value of a checkbox field called “flipme” from checked to unchecked (or back the other way). Easy to modify to whatever specific need you have.

Create a button field that runs this script and you’re set.

See Solution in Thread

4 Replies 4

If the button launches a script that POSTs to the webhook, then yes. Otherwise no.

Just a note: No webhook can create an automation.

Or the button could run a script that creates or updates a record such that the change triggers an existing automation.
But it still requires a script.

David_Solimini
6 - Interface Innovator
6 - Interface Innovator

You can use a button to trigger a script, as @kuovonne notes, and that script can flip a checkbox. THat change can trigger the automation (meets a condition).

Here’s a quick script I hacked toegther from various sources that does this:

let table = base.getTable("Pipeline"); //The name of the table you're in here
let record = await input.recordAsync('Pick a record', table);
if (record) {
   
 if (record.getCellValue("flipme")===true) {
    table.updateRecordAsync(record, {'flipme': false});
 } else { table.updateRecordAsync(record, {'flipme': true});}
output.text('Value flipped');
    
}

All this does is take the given record and change the value of a checkbox field called “flipme” from checked to unchecked (or back the other way). Easy to modify to whatever specific need you have.

Create a button field that runs this script and you’re set.

Thanks @David_Solimini and @kuovonne for the tip! Smart and easy (indirect) way to make it happen.