What's the difference between TODAY()+60=[Deadline] and TODAY()=[Deadline]-60 ?

Hi community,

It appears that this formula used as a BOT : TODAY()+60=[Deadline] does not trigger the BOT

but this formula does : TODAY()=[Deadline]-60

To me, these two equations are exactly the same but it seems not for AppSheet. Could anyone give some explanation? I have the feeling I miss something and I don't want to do the same mistake again.

Thanks!

0 13 520
13 REPLIES 13

Try (TODAY()+60)=[Deadline]

Thanks for the suggestion. I did already and it does not change anything. In fact, the AppSheet support told me this : "The example you have written is an algebra expression which is not similar to appsheet expression." with this link 

http://www.google.com/url?sa=D&q=https%3A%2F%2Fsupport.google.com%2Fappsheet%2Fanswer%2F10107326%3Fh...

But I was not able to understand the difference between the two erpressions.

 

Honestly, I don't know the correct explanation, but if I had to imagine an argument... It occurs to me that perhaps what you are telling it is that it should be executed only if it is today + 60 = x, which will never arrive because today plus 60 will always be 60 days ahead in the future. It is what occurs to me 

Hi Kabuliño, 
I understand what you mean but, I my case, "x" is known. I have a list of Deadline predefined.

For example, if [Deadline]="5-Feb-2023", then "7-Dec-2022"+60="5-Feb-2023" is correct and the BOT should be triggered.

But only "7-Dec-2022"="5-Feb-2023"-60 really works

Hi @Julien ,

Just for community benefit, you may want to share more details about the BOT and where the condition is used and not working. Maybe your configuration and requirement is different than the example tested below.

I tried with a data change bot and the bot fires for the [Delivery Date] of 5th February 2023  if fired today on 7th December 2022 with the following condition.  

Suvrutt_Gurjar_0-1670411545194.png

 

Email body of the email fired from the bot below.

Suvrutt_Gurjar_2-1670411711811.png

 

 

Hi Suvrutt_Gurjar,

Yes indeed, it's a good idea to share more details about the BOT event.

It is a Daily Schedule event type (not a Data Change).

The print screen below is the BOT that currently works.

It used not to work when the expression was TODAY()+60=[Deadline]

Julien_0-1671017431737.png

 

Thank you @Julien . At least in my test when I ran a scheduled bot with a similar condition , it ran well. Of course since my app was not deployed, I tested it with Run button. But it selected records after 60 days from today and sent emails.

Scheduled BOT-1.pngScheduled BOT-2.pngScheduled BOT-3.png

 

Is [Deadline] a Date, or a DateTime?

Regardless, you always have to be wary of comparing Dates to DateTimes. A Date is basically the same as a DateTime, just with it's time set as 00:00:00. Whenever doing math on a Date, if you're wanting a Date value to be returned instead of a DateTime, it may be prudent to wrap the result in DATE(). Appsheet tries to be smart with stuff like this, but sometimes it fails. Another smart method is to use less-than or greater-than instead of a strict equals, if the situation allows.

Thanks Marc_Dillon, [Deadline] is a Date type.

And I used an equal sign because I needed the BOT to send an email 60 days before the deadline. Not one every day during 60 days 😉

I'm curious now if reversing each formula would have the opposite effect:

[Deadline] = TODAY()+60 > result bot will execute

[Deadline]-60 = TODAY() > result bot will not execute

I'm just wondering if there is some precedence for AppSheet whether the algebraic part of the comparison can only occur on the right side of the comparative operator =, >, <, <> (= sign in your case). That would explain why TODAY()+60 on the left side of = did not execute.

It sounds like Appsheet expression parser for Automation is carrying some bugs.

 

Steve
Platinum 5
Platinum 5

@Julien wrote:

In fact, the AppSheet support told me this : "The example you have written is an algebra expression which is not similar to appsheet expression."


Clearly, the support agent doesn't know AppSheet.

Quite.

Top Labels in this Space