Hi community!
Is it possible to trigger a built-in Airtable automation (example: Create a custom automation) when a button is clicked?
Thanks!
Answer
Trigger Built-in Airtable automation with a button?
Best answer by David_Solimini
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.
Login to the community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
