Oct 09, 2020 01:28 PM
I wanted to share what I figured out looking for a way to run an automation at a scheduled time.
First, create a helper table named Automation Trigger with 3 columns:
RECORD_ID()
)
For each automation you want to schedule:
Add an automation:
Finally, the scheduling piece. You’ll need Integromat or Zapier. Zapier allows to schedule a task only at a selected hour. Whereas Integromat is much more flexible. For example, you can schedule an action at regular intervals.
now
That’s it. Integromat will update the record in the Automation Trigger table at the specified schedule what in turn will trigger your automation in Airtable.
I’m looking forward to your feedback. Is there a way to simplify this solution?
Mar 14, 2021 01:46 AM
Thank you @kuovonne.
Wasn’t aware of the hourly updates when the base is closed.
Jul 17, 2022 06:59 PM
Hi Justin,
I’m looking to do something similar, I want to run an automation every 2 hours, where every record that matches the conditions within the last 2 hours will be emailed as a grid.
Details are:
When field ‘notification type’ is ‘non-urgent’ (this is a single select field)
Send email including a grid of all non-urgent records.
I want this to run every 2 hours, and only send records that match the condition since the automation last ran. If no records match the condition
Are you able to help with that?
At the moment if I try run at a scheduled time, it will send an email of all records that match the condition, not just the ones that have been updated to match it since the automation last ran.
Jul 18, 2022 04:54 PM
You didn’t mention what workspace plan your base is in, so I’m not sure if you can use scripting in your automations. I’ve got an idea for a way to pull this off without scripting, but it’s imprecise because it relies on comparing against the NOW()
function. That function’s output only updates on certain intervals—roughly every 15 minutes if the base is open, and every 60 minutes if it’s closed—so it’s possible that some records would be missed.
If your base is in a Pro-plan workspace or higher, you could modify your “Find records” action condition to find records that are not marked a certain way—e.g. with a check in a {Notified}
checkbox field—insert those records into the email, and then use a “Run a script” action to mark them so that they’re ignored the next time around:
const {recordIds} = input.config()
const table = base.getTable("Table Name")
const updates = recordIds.map(id => ({id, fields: {"Notified": true}}))
while (updates.length) await table.updateRecordsAsync(updates.splice(0, 50))