# Calling NOW() multiple times in the same formula

**URL:** https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659
**Category:** Airtable Questions
**Created:** [June 8, 2023, 2:59pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659 "2023-06-08T14:59:07Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![julian.post](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/julian.post/32/1032_2.png) [@julian.post](https://air.tableforums.com/u/julian.post)
#### Post date: [June 8, 2023, 2:59pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/1 "2023-06-08T14:59:07Z")

</div>

I’m more careful in my use of the NOW() formula after reading that it takes a lot of processing power, since it is constantly running to update the value of _now_. But when you do use it, does it matter how many times it is used in a formula? For example, to trigger a status change within a 5-minute range after a record is modified, you could evaluate when

`DATETIME_DIFF(NOW(),LAST_MODIFIED_TIME(),'minutes')>0` and `DATETIME_DIFF(NOW(),LAST_MODIFIED_TIME(),'minutes')<6`

This uses two NOW() functions. Or you could use a Switch statement which calls NOW() once, and outputs the same outcome:

`Switch(DATETIME_DIFF(NOW(),LAST_MODIFIED_TIME(),'minutes'),`  
`1, 'Within Range', `  
`2, 'Within Range',`  
`3, 'Within Range',`  
`4, 'Within Range',`  
`5, 'Within Range')`

In a very large base, is there enough difference here to care?

---

<div class="post-metadata">

### Author: ![Kuovonne](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/kuovonne/32/17_2.png) [@Kuovonne](https://air.tableforums.com/u/Kuovonne)
#### Post date: [June 8, 2023, 4:43pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/2 "2023-06-08T16:43:32Z")

</div>

> [@julian.post](#):
>
> I’m more careful in my use of the NOW() formula

Good idea.

> [@julian.post](#):
>
> `DATETIME_DIFF(NOW(),LAST_MODIFIED_TIME(),'minutes')>0` and `DATETIME_DIFF(NOW(),LAST_MODIFIED_TIME(),'minutes')<6`

`NOW()` is so far off from being accurate that these formulas aren’t going to be useful. Even when a base is open, `NOW()` can be off by 5-10 minutes, which makes such small intervals very precise but not very accurate.

> [@julian.post](#):
>
> In a very large base, is there enough difference here to care?

In a large table, I would try very hard to avoid use of `NOW()` at all. And for the formulas that you’ve shown, I don’t think they will be useful at all.

Why do you need to know what has been modified in the last five minutes?

---

<div class="post-metadata">

### Author: ![julian.post](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/julian.post/32/1032_2.png) [@julian.post](https://air.tableforums.com/u/julian.post)
#### Post date: [June 8, 2023, 4:59pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/3 "2023-06-08T16:59:58Z")

</div>

Thanks @Kuovonne. I’m setting up a Slack notification for specific changes to a record. One of the fields that I’m watching is a text field, so I need to delay the trigger. Otherwise, the notification could go out while someone is in the middle of typing. Is there another way to do this? Airtable actually has a page on delayed notifications and they use the NOW() formula in their [suggested system](https://support.airtable.com/docs/delay-an-automation-from-running). It also compares NOW() with operators, which I think I saw you or Bill flag as very processing intensive too…

---

<div class="post-metadata">

### Author: ![Kuovonne](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/kuovonne/32/17_2.png) [@Kuovonne](https://air.tableforums.com/u/Kuovonne)
#### Post date: [June 8, 2023, 5:04pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/4 "2023-06-08T17:04:26Z")

</div>

Yeah, it’s a total guessing game to try and figure out when someone is done typing. I wouldn’t use NOW() for that. I would use a workflow when the user does something else to indicate that data entry is complete, like selecting a checkbox, setting a single-select, or pressing a button.

---

<div class="post-metadata">

### Author: ![ScottWorld](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/scottworld/32/5_2.png) [@ScottWorld](https://air.tableforums.com/u/ScottWorld)
#### Post date: [June 8, 2023, 5:25pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/5 "2023-06-08T17:25:05Z")

</div>

@julian.post

I agree with @Kuovonne’s assessment of this. The way that I do this for my clients is to give them a single-select field that is right next to the text field, with a list of options to choose from. For example:

_Send Slack Notification_  
_Send Email Notification_  
_Create Proposal in Microsoft Word_  
_Create Invoice in Microsoft Word_  
_etc._

Sometimes I create multiple different single-select fields, depending on the client’s workflow.

Now granted, this DOES require the user to manually be involved with triggering their own automation, but it prevents all the other problems from happening.

---

<div class="post-metadata">

### Author: ![julian.post](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/julian.post/32/1032_2.png) [@julian.post](https://air.tableforums.com/u/julian.post)
#### Post date: [June 8, 2023, 5:28pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/6 "2023-06-08T17:28:09Z")

</div>

In this case, users making edits are not the same users who care deeply about getting a notification when there’s a change, and could easily leave a checkbox unchecked. So you’re up against the unreliability of a user vs. the unreliability of the NOW() function. You could require a checkbox in an interface or a form, but not in a grid

---

<div class="post-metadata">

### Author: ![Kuovonne](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/kuovonne/32/17_2.png) [@Kuovonne](https://air.tableforums.com/u/Kuovonne)
#### Post date: [June 8, 2023, 5:28pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/7 "2023-06-08T17:28:33Z")

</div>

> [@ScottWorld](#):
>
> The way that I do this for my clients is to give them a single-select field that is right next to the text field, with a list of options to choose from.

I think of these single-selects as “Action” single selects. I typically have a single automation that watches for when the single select has a value. The automation has a conditional actions for each choice. The automation also resets the value of the single-select to blank so that a new action can be taken later.

---

<div class="post-metadata">

### Author: ![julian.post](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/julian.post/32/1032_2.png) [@julian.post](https://air.tableforums.com/u/julian.post)
#### Post date: [June 8, 2023, 5:31pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/8 "2023-06-08T17:31:55Z")

</div>

Without relying on a user, I guess you could have a scheduled automation run a Find Records action once every half hour. Then you still might catch someone in the middle of typing though.

---

<div class="post-metadata">

### Author: ![Kuovonne](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/kuovonne/32/17_2.png) [@Kuovonne](https://air.tableforums.com/u/Kuovonne)
#### Post date: [June 8, 2023, 5:31pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/9 "2023-06-08T17:31:59Z")

</div>

> [@julian.post](#):
>
> users making edits are not the same users who care deeply about getting a notification when there’s a change

There are other workarounds.

For example, one workaround is to trigger the automation when the field has a value, but then put the delay in the automation itself. Then do a fresh read of the text value with a “Find records” action, and send the result of the find.

To get the day, you use scripting to put in a delay of up to 30 seconds, and chain as many of these delays as you need. So, for a five minute delay, you would need 10+ scripting actions, probably with a deal of 29 seconds to avoid erroring out.

---

<div class="post-metadata">

### Author: ![Kuovonne](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/kuovonne/32/17_2.png) [@Kuovonne](https://air.tableforums.com/u/Kuovonne)
#### Post date: [June 8, 2023, 5:34pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/10 "2023-06-08T17:34:05Z")

</div>

> [@julian.post](#):
>
> users making edits are not the same users who care deeply about getting a notification when there’s a change

Of course they are different people. The people making the change don’t need a notification because they already know there is a change, since they are the ones making it.

On the other hand, do they care about doing their jobs right? If they do care, then usually training is okay. If they don’t care (and plenty of them don’t care), you have to resort to other tricks.

---

<div class="post-metadata">

### Author: ![Kuovonne](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/kuovonne/32/17_2.png) [@Kuovonne](https://air.tableforums.com/u/Kuovonne)
#### Post date: [June 8, 2023, 5:35pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/11 "2023-06-08T17:35:50Z")

</div>

> [@julian.post](#):
>
> I guess you could have a scheduled automation run a Find Records action once every half hour. Then you still might catch someone in the middle of typing though.

Yeah, it is a matter of how quickly do the people need to get the notifications, and how many notifications will they need to get? If they would likely get only a few notifications, polling every half hour is a waste of automations. If they will get lots of notifications, triggering individual might result in an overabundance of notifications. Workflow also matters if they want to keep each issue in its own thread.

---

<div class="post-metadata">

### Author: ![julian.post](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/julian.post/32/1032_2.png) [@julian.post](https://air.tableforums.com/u/julian.post)
#### Post date: [June 8, 2023, 5:35pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/12 "2023-06-08T17:35:58Z")

</div>

> [@Kuovonne](#):
>
> There are other workarounds.
> 
> For example, one workaround is to trigger the automation when the field has a value, but then put the delay in the automation itself. Then do a fresh read of the text value with a “Find records” action, and send the result of the find.
> 
> To get the day, you use scripting to put in a delay of up to 30 seconds, and chain as many of these delays as you need. So, for a five minute delay, you would need 10+ scripting actions, probably with a deal of 29 seconds to avoid erroring out.

This seems like potentially the best solution in terms of reliability, if the scripting action can accurately time it. What’s the function that you would use to do this?

---

<div class="post-metadata">

### Author: ![Kuovonne](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/kuovonne/32/17_2.png) [@Kuovonne](https://air.tableforums.com/u/Kuovonne)
#### Post date: [June 8, 2023, 5:39pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/13 "2023-06-08T17:39:29Z")

</div>

> [@julian.post](#):
>
> if the scripting action can accurately time it. What’s the function that you would use to do this?

The script that introduces the delay is pretty accurate. It can be done in a few short lines, and there are a few different versions. I sell one version in my [Automation helpers](https://kuovonne.gumroad.com/l/automationHelperScripts). You can also google and find various versions. It’s a pretty simple script.

I might add this technique to my Guide to Scripting, if you are willing to wait.

---

<div class="post-metadata">

### Author: ![ScottWorld](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/scottworld/32/5_2.png) [@ScottWorld](https://air.tableforums.com/u/ScottWorld)
#### Post date: [June 8, 2023, 5:45pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/14 "2023-06-08T17:45:57Z")

</div>

> [@Kuovonne](#):
>
> The automation also resets the value of the single-select to blank so that a new action can be taken later.

Yes. I actually take this one step further. The single-select will change to the word “Done” (in green) if it was completed successfully, and it will change to the word “Error” (in red) if there was a problem.

These options are at the very bottom of the single-select list, separated from the actions by a blank option that is colored in grey.

---

<div class="post-metadata">

### Author: ![Kuovonne](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/kuovonne/32/17_2.png) [@Kuovonne](https://air.tableforums.com/u/Kuovonne)
#### Post date: [June 8, 2023, 5:50pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/15 "2023-06-08T17:50:04Z")

</div>

> [@ScottWorld](#):
>
> it will change to the word “Error” (in red) if there was a problem

Not to derail Julian’s thread, but I like to have a separate text field for reporting errors or other feedback from the automation so that I can be more descriptive. I usually have a datestamp as part of the text field that is set by the automation so people can see the result of the most recent automation run. Depending on the situation, I either clear the message field for each run, or I just tack on to the top of the text field so it is an ongoing log.

---

<div class="post-metadata">

### Author: ![ScottWorld](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/scottworld/32/5_2.png) [@ScottWorld](https://air.tableforums.com/u/ScottWorld)
#### Post date: [June 8, 2023, 6:52pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/16 "2023-06-08T18:52:25Z")

</div>

@Kuovonne Love it!! I think you just came up with a roundtable discussion topic for a future BuiltOnAir podcast! 😉

I’m going to tag @dan here!

---

<div class="post-metadata">

### Author: ![bfrench](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/bfrench/32/46_2.png) [@bfrench](https://air.tableforums.com/u/bfrench)
#### Post date: [June 8, 2023, 8:07pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/17 "2023-06-08T20:07:07Z")

</div>

> [@julian.post](#):
>
> So you’re up against the unreliability of a user vs. the unreliability of the NOW() function.

Um, isn’t there a third option? Event trigger? I assume this is for a customer with an enterprise instance? If so, isn’t [this](https://airtable.com/developers/web/api/webhooks-overview) exactly what you need to avoid all this crap?

---

<div class="post-metadata">

### Author: ![julian.post](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/julian.post/32/1032_2.png) [@julian.post](https://air.tableforums.com/u/julian.post)
#### Post date: [June 8, 2023, 8:10pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/18 "2023-06-08T20:10:31Z")

</div>

@bfrench can you elaborate? How would you use a webhook to solve this problem?

---

<div class="post-metadata">

### Author: ![julian.post](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/julian.post/32/1032_2.png) [@julian.post](https://air.tableforums.com/u/julian.post)
#### Post date: [June 8, 2023, 8:12pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/20 "2023-06-08T20:12:08Z")

</div>

> [@Kuovonne](#):
>
> The script that introduces the delay is pretty accurate. It can be done in a few short lines, and there are a few different versions. I sell one version in my [Automation helpers](https://kuovonne.gumroad.com/l/automationHelperScripts). You can also google and find various versions. It’s a pretty simple script.
> 
> I might add this technique to my Guide to Scripting, if you are willing to wait.

Thanks @Kuovonne! I’ll check that out

---

<div class="post-metadata">

### Author: ![bfrench](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/bfrench/32/46_2.png) [@bfrench](https://air.tableforums.com/u/bfrench)
#### Post date: [June 8, 2023, 8:19pm UTC](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659/21 "2023-06-08T20:19:45Z")

</div>

> [@julian.post](#):
>
> I’m setting up a Slack notification for specific changes to a record.

> [@julian.post](#):
>
> How would you use a webhook to solve this problem?

As I read through the threads, I assume you are jousting with the definition of a fully changed field - i.e., a field that was changed and committed such that no more changes are being typed, right? It’s a timing issue and it’s because Airtable doesn’t expose a method for knowing the field edit has been committed.

The Enterprise events API does support that definition, making it possible to trigger a webhook when, and only when, the timing is not in question; the record has been changed and committed.

[Next page](https://air.tableforums.com/t/calling-now-multiple-times-in-the-same-formula/659.md?page=2)
