Help

Automation run on a time interval

Solved
Jump to Solution
6188 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Paul_Warren
8 - Airtable Astronomer
8 - Airtable Astronomer

Hello everyone! I’m having significant challenges with getting an automation to run on a schedule.

Airtable says:
" Can I set up a script to run on a schedule using Automations?

  • At the moment, there isn’t a built-in way to set up a script that runs on a regular time-based schedule (e.g. every day at 9am). A workaround is to use a time-based filter on a view."

However, the time filter doesn’t seem to work very well for more frequent than daily. I was able to get ~ every minutes, but I was hoping to get something more real-time. To test the concept, I made a table where the first column is the “age” of the record using the following formula:

DATETIME_DIFF(NOW(),CREATED_TIME(),"seconds")

I then set up the automation to trigger when a record enters a view which filters all records newer than 10 seconds. The automation adds a new record to the same table. In theory, the automation should be running every 10 seconds continuously.

But, that formula only updates every 5 minutes or so. I’m not 100% certain on the time interval, but refreshing the base does not cause it to update.

Any thoughts on how to run a script more often than every 5 minutes?

p.s. This is to automate back-linking to prevent misinformation when records aren’t back-linked properly.

1 Solution

Accepted Solutions
Paul_Warren
8 - Airtable Astronomer
8 - Airtable Astronomer

I figured it out! My assumptions were wrong, so forgive me for throwing everyone off the right track.

Requirements:

  1. After linking a record to another record in the same table (self-linking field “Next Task”), the reverse link (“Previous Task”) needs to be created without user input.
  2. This action should be executed soon after the record linking was changed.
  3. The action may be required several times in a short time period.

My first assumption was that the automation trigger should be the record entering a view filtered by the modified time of the “Next Task” field. If the modified time was in the last minute, the automation should be triggered. However, this is foolish, because the NOW() function does not update fast enough.

In the shower last night I realized I was going about this all wrong! Below is the correct process laid out the best I can:

  1. Look up the “Previous Task” field of the “Next Task” (Field: “nextTasksPreviousTasks”)
  2. SEARCH() if the Primary Field, “Task ID”, is found within “nextTasksPreviousTasks”
  3. Look up “Next Task” of “Previous Task” (Field: “previousTasksNextTasks”)
  4. SEARCH() if the “Task ID” is found within “previousTasksNextTasks”
  5. IF() either SEARCH() fails then flag in “missingLinks”
  6. Create view filtered on “missingLinks”. (View: “BacklinkingAutomation”
  7. Trigger Automation based on “BacklinkingAutomation” view.

The Automation triggers a script developed by @openside: New Script: Same Table Linked Records Backlinks

A few modificaitons had to be made to eliminate calls to the “Output”.

Works beautifully now :grinning_face_with_big_eyes:

See Solution in Thread

3 Replies 3

It’s not the formula update that runs every 5-ish minutes. From my tests, it’s the refreshing of the NOW() calculation. Other formulas I’ve used to trigger automations will update virtually instantly, but any time you’re comparing against NOW(), you can’t guarantee precision.

Can you share more details? There might be a different way to solve the problem, but without knowing more about your setup, particularly how records are made/updated that would lead to missing back-links, it’s hard to know where to begin.

If you need precise scheduling, I would just go with Integromat which has very extensive built-in scheduling, and you can repeat triggers every 1 minute on their Standard Plan.

Paul_Warren
8 - Airtable Astronomer
8 - Airtable Astronomer

I figured it out! My assumptions were wrong, so forgive me for throwing everyone off the right track.

Requirements:

  1. After linking a record to another record in the same table (self-linking field “Next Task”), the reverse link (“Previous Task”) needs to be created without user input.
  2. This action should be executed soon after the record linking was changed.
  3. The action may be required several times in a short time period.

My first assumption was that the automation trigger should be the record entering a view filtered by the modified time of the “Next Task” field. If the modified time was in the last minute, the automation should be triggered. However, this is foolish, because the NOW() function does not update fast enough.

In the shower last night I realized I was going about this all wrong! Below is the correct process laid out the best I can:

  1. Look up the “Previous Task” field of the “Next Task” (Field: “nextTasksPreviousTasks”)
  2. SEARCH() if the Primary Field, “Task ID”, is found within “nextTasksPreviousTasks”
  3. Look up “Next Task” of “Previous Task” (Field: “previousTasksNextTasks”)
  4. SEARCH() if the “Task ID” is found within “previousTasksNextTasks”
  5. IF() either SEARCH() fails then flag in “missingLinks”
  6. Create view filtered on “missingLinks”. (View: “BacklinkingAutomation”
  7. Trigger Automation based on “BacklinkingAutomation” view.

The Automation triggers a script developed by @openside: New Script: Same Table Linked Records Backlinks

A few modificaitons had to be made to eliminate calls to the “Output”.

Works beautifully now :grinning_face_with_big_eyes: