How to know the current hour?

I’m trying to send notifications while avoiding them being sent at midnight UTC (one of the trigger conditions is the number of days since an event has happened).

I’d like them to be sent at 6pm UTC+2, not at midnight, but I also want them to trigger based on conditions, and can’t use the “Scheduled time” because then it’d run only one time for all the record that matches (I need to run it once per record), as I’m sending one SMS to each user.

Is there a way to have a formula field with the current time of the day (the hour)? Or another way?

Hi @Ambroise_Dhenain

NOW()

Will give you the current time.

This function updates when the formula is recalculated, when a base is loaded, or otherwise roughly every 15 minutes when a base is open. If the base is closed, it will update approximately every hour only when the base has time-dependent automation triggers or actions, or sync dependencies.

1 Like

I tried to use TODAY() instead of NOW() so far, I thought they were the same.

I think this might just work, considering I need to send SMS “around some time”. The unreliability might not be an issue.

I do not think that TODAY() returns the time.

While similar to the TODAY() function, NOW() returns the current date AND time.

TODAY() returns the GMT date with a time of midnight GMT for when it was last recalculated. The time of TODAY() will always be GMT midnight, although the actual date and time may differ from what you expect depending on whether or not you display the result in local time and what time zone you are in.

NOW() returns the GMT date and time for when it was last calculated. Again, this value might be different from what you expect based on your time zone, the timezone settings for your field, and when it was last recalculated.

Just popping in with a word of caution - if you have a large base with complex relationships, using NOW() can potentially impact performance. I speak from experience :innocent: I now try really hard to avoid using it at all costs (lame pun very much intended).

My workaround to trigger many automations at a specific time is usually something like this:

  1. Set up an automation triggered at a specified time
  2. Use a scripting step to find the applicable records and update a value (I usually use a single select field and set the value to something like “:zap:Run”
  3. Setting the single select value can then trigger a second automation for each applicable record, perform whatever action you want (I.e send an SMS), and then finally set the value of the single select to something like “:white_check_mark: Complete”. This allows you to trigger the automation again if you need to.
2 Likes

Good feedback and good workaround. Thanks for sharing.

I haven’t done it your way, and I find it a bit complicated (and it consumes 2 automations) but it definitely has its “pros”. I’d probably rather simply write a script, if possible, or use Zapier/Make to avoid using 2 out of the 25 automations.

Wouldn’t it be for that 25 limit, your way would probably be better in most cases.

You can now have 50 automations.

1 Like

You are entirely welcome and thank you for the feedback as well! I totally agree that it is a bit complicated, and I wish it didn’t consume two automations. I’ve thought about ways to condense it into one script, but if you want to perform an action such as sending a personalized email to each record, that script would likely need to involve calling an API and at that point I’d rather just use an extra automation (as long as I have one to spare, lol).

When did that change? I’m following all updates and I haven’t since that one.

The increase to 50 named automations per base happened earlier this month. You can also arrange automations in sections, so you can group the two automations involved in this workflow together.

1 Like

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.