Oct 07, 2021 08:29 AM
Hi Everyone,
I’m currently trying to set up an automation that only triggers during working hours, and ‘banks’ any non-triggered actions until the next working day. I.e. it only trigger between 9am and 5pm, and anything that would normally trigger it at 6pm is held until 9am the next working day.
I think I have a working solution, but would be interested to hear if anyone can think of anything better/simpler?
The context is a quality assurance process where an assessor completes an Airtable form, and when the form is submitted the assessee automatically receives an email with the results. Currently I have an email automation set up to just trigger when a new record is created (from the form).
My idea for how to limit the automation to working hours is:
I’m pretty sure this would work, although I haven’t tested it yet. Downsides are that everything would go out of sync by an hour during daylight savings time. It’s also more complicated/obtuse than a straightforward automation, and I’m conscious of not wanting to build things where only I know how they work.
Any ideas on better solutions?
Thanks so much!
Tom
Oct 10, 2021 03:39 AM
I just answered another user’s question that’s in a very similar vein.
In your situation, you could use this formula:
SET_TIMEZONE(NOW(), "America/Los_Angeles") > DATEADD(
WORKDAY(CREATED_TIME(), 1),
MAX(MIN(HOUR(SET_TIMEZONE(CREATED_TIME(), "America/Los_Angeles")), 9), 9)
- HOUR(SET_TIMEZONE(CREATED_TIME(), "America/Los_Angeles")),
"hours"
)
(change the timezone references as appropriate for your region)
That will calculate a time within the 9 o’clock hour on the next workday based on the created time of the record, and compare that against NOW()
. When NOW()
passes that calculated time, the formula will output a 1; otherwise it will output a 0. Set your automation to fire when any record outputs a 1 from that formula field, which will only happen once per record.