Skip to main content

Hi all!


I have a problem that I feel should have an obvious solution: I’d like to set up an Automation that normalizes a string value after input by base collaborators. However, the Automation appears to run too early, catching only parts of the input string. (This behavior is not consistent, though: From time to time the Automation will catch the whole string.)


I selected When record updated as trigger and configured it to watch only for changes in a specific field (in my case: Keyword).


Example from the screenshot: The entered text is “Aldi Angebote”, but the Automations appears to run already after the first letters are typed in, so only “Ald” is used as Automation input.



What’s the best way to solve this problem? Is there a better trigger for this use case that I am missing?

Unfortunately, one simple keystroke is enough to register as an update to the record, because Airtable sees ANY change to the field as an immediate update.

Airtable never waits until the person leaves the field to trigger an automation.

There are 2 easy solutions for this problem:

  1. You can change your automation’s trigger to be based on a checkbox field or a single-select field. These 2 fields are reliable ways to trigger an automation.

    Even better, if you use a single-select field, you can even give status updates about the automation’s progress to your users by using that very same single-select field.

    I give more information on this technique in this thread.
     
  2. You can use Fillout’s advanced forms for Airtable, which allows you to update your existing Airtable records with a form.

    This method will always work, because it updates records using Airtable’s API. And when you use Airtable’s API, all the fields are updated in one fell swoop.

Hope this helps!

If you’d like to hire the best Airtable consultant to help you with this or anything else that is Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld


You will need to trigger your automation differently, because unfortunately, Airtable sees any change to the field as an immediate update. One simple keystroke is enough to register as an immediate update. Unfortunately, Airtable never waits until the person leaves the field/record to trigger an automation.


So, in your case, you could create a checkbox field or a single-select field to trigger the automation — these are 2 of the very few reliable ways to trigger an automation in Airtable.


I was already afraid that something like this would be the only solution - thanks anyway!


I was already afraid that something like this would be the only solution - thanks anyway!

 

You’re welcome!

If you’d like to hire the best Airtable consultant to help you with this or anything else that is Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld

 


The other option is to have a script add a 25 second delay. This is something we use but it’s unfortunate Airtable doesn’t have a more elegant option

 


The other option is to have a script add a 25 second delay. This is something we use but it’s unfortunate Airtable doesn’t have a more elegant option

 

@JeremyK Creative approach! Thanks for sharing this.

I have two questions about this:
1. How do you create a delay in the automation?
2. Would the automation still trigger just as many times? Say you were typing “The quick brown fox jumped over” and it triggered the automation 4 times while you were typing. Would your approach also trigger 4 times?

Thanks again for sharing!


@BuildForAT 

1) Below is the script for the delay. 

2) The automation would only trigger once. So if you start typing in a field, it will activate the automation and then delay 29 seconds (or whatever you set it to) and then it will execute the next step.


 



function delay(ms) {
console.log("delaying 29 seconds");
var limit = new Date();
limit = limit.setMilliseconds(limit.getMilliseconds() + ms);
while ((new Date()) < limit) {
// do nothing
;
}
}
delay(29000); //delay 29 seconds

 


Hey ​@BuildForAT,

My experience is that the automation will still get triggered multiple times (different to ​@JeremyK’s opinion above). The trigger (record being updated) is still being met. But each execution after such trigger being met (record being updated) will be delayed.

Mike, Consultant @ Automatic Nation 


Thank you ​@JeremyK for sharing the script! This will definitely be useful for me in the future.

Thanks ​@Mike_AutomaticN for letting me know. I tested the script out and it does trigger the automation multiple times.


Just as another option since it’s written slightly differently, I’ve had this script from Git bookmarked for quite awhile should I ever need it. 🤷‍♂️

function delay(ms) {
let limit = new Date();
limit = limit.setMilliseconds(limit.getMilliseconds() + ms);
while ((new Date()) < limit) {
// do nothing
;
}
console.log(`Finished in ${ms / 1000} seconds`)
}
delay(20000)

Credit from here 


Reply