Help

Re: Conditional Automation Button Based on time it was Last Clicked

Solved
Jump to Solution
1708 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Jordan_M
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello,

I have an automation based on a button click that creates a number of records in a separate base based on what is selected in a multi select field. The automation itself works well, but I am having an issue with people accidently clicking the button multiple times and creating duplicate records. They do need the functionality to run the automation if the multi select field changes, though.

My thought was I could use the now() function in a field to essentially create a "Button last clicked" field, use a formula to compare that to the last time the multi select field was modified, and then use that formula's output as a conditional check for an action within the button automation.

The issue I am having with this approach is around the now() function, the field only seems to update every 10-60 minutes. So within those 10-60 minutes, the check doesn't work and the button can be clicked multiple times.

Is there a better approach to this? A way to work around the now() function providing an accurate time consistently?

Thanks,

Jordan

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

Does the automation create new records in a different base or new linked records in a different table?

If it creates new linked records, can you have a rollup field that compares the linked records with the multi-select to determine if there are enough records?

Can you trigger the automation off the change in the multi-select instead of the button?


It could also be a matter of training. Automations are very slow compared to how fast users expect things to happen. It can take several seconds for an automation to run, and if a user isn’t sure if a button click “took”, the natural response is to click the button again. Can you train users to look for the “Started” toast that appears in the bottom left corner when an automation is started from an interface button?

Finally, there are ways to use scripting to get the automation run time and compare that to the last modified time. But that requires scripting and you still have to guess about the interval to wait. I would prefer other methods.

See Solution in Thread

3 Replies 3
kuovonne
18 - Pluto
18 - Pluto

Does the automation create new records in a different base or new linked records in a different table?

If it creates new linked records, can you have a rollup field that compares the linked records with the multi-select to determine if there are enough records?

Can you trigger the automation off the change in the multi-select instead of the button?


It could also be a matter of training. Automations are very slow compared to how fast users expect things to happen. It can take several seconds for an automation to run, and if a user isn’t sure if a button click “took”, the natural response is to click the button again. Can you train users to look for the “Started” toast that appears in the bottom left corner when an automation is started from an interface button?

Finally, there are ways to use scripting to get the automation run time and compare that to the last modified time. But that requires scripting and you still have to guess about the interval to wait. I would prefer other methods.

Jordan_M
5 - Automation Enthusiast
5 - Automation Enthusiast

Thank you! The issue was that when I clicked the button I was updating a field with the now() function and comparing that to the last time the multi select was modified. Since the now() could have a lag of 10-60 minutes, is still allowed clicks and duplicate records.

After sleeping on it and thinking about your suggestions, I implemented the following solution. Essentially, I replaced the now() with a rollup function, looking at the time the new records were created and using the max of those times/dates....which is an accurate time of the last button click. The rest of the formula basically stayed the same!

Thanks again,

Jordan

Jordan_M
5 - Automation Enthusiast
5 - Automation Enthusiast

For anyone that may find this in the future, I used this as an excuse to start learning how to script in Airtable.

 

The problem I was running into was getting a now() timestamp when the automation button was cl

icked, as the now() function has a lag of 10-30 minutes before updating (So the timestamp would be 10-30 minutes early).

I wrote a very simple script to work around this to timestamp when the button is clicked:

let inputConfig = input.config();
let table = base.getTable("Projects");
await table.updateRecordAsync(inputConfig.RecordID,{
    "Button Last Clicked": new Date()
});