Conditional test error

(Rpd Mobile Apps) #1

Hi Appsheet!

I have found this bug in my app that took me a lot of time to narrow down to this simple expression:

MIN(LIST([DateTime1], [DateTime2], [DateTime3])) = [DateTime1]

Here, I am comparing the value of the first DateTime stamp with a DateStamp column. It always returns TRUE.

I paraphrased the expression with this and the expression returns the desired output:

NOT(MIN(LIST([DateTime1], [DateTime2], [DateTime3])) <> [DateTime1])

1 Like

I assume you already checked what just “MIN(LIST([DateTime1], [DateTime2], [DateTime3]))” is actually returning? Might help to provide that info and what the value of DateTime1 actually is. If you are comparing a date vs datetime.

(Steve Coile) #3

Are “DateTime stamp” and “DateStamp” the same thing?

(Steve Coile) #4

What does this mean?

(Steve Coile) #5

And to be clear, MIN() used with chronological types returns the earliest/oldest value.

(Rpd Mobile Apps) #6


Ow sorry I made a typo. They are all DateTime values, there is no Date value in the expression.

[DateTime1] = “3/21/2019 8:00:00”
[DateTime1] = “3/21/2019 7:59:00”
[DateTime1] = “3/21/2019 7:58:00”

I was comparing if the earliest of the 3 DateTime values equate to the first DateTime value. Using the MIN() function, I tried to get the earliest DateTime value and then tried to compare to the first DateTime value.

The first expression was checking using the direct method of:
“Is earliest DateTime equal to the first DateTime value?”
- This always returns TRUE, with whatever values I put in the 3 columns.

So I tried to reconstruct by wrapping the expression with NOT() and replaced the equal sign with not equal (<>).
“Opposite of the value given by (Is earliest DateTime not equal to the first DateTime value?)”
- This now give me the logical value.

I hope I explained clearly

(Rpd Mobile Apps) #7


Sorry I made a typo. They are all DateTime values. I meant “paraphrased” by reconstructing the expression. I used LIST() to construct a list of DateTime values, and MIN() to get the earliest DateTime from that list.

1 Like
(Steve Coile) #8

Does the following return the correct value?

min(list("3/21/2019 8:00:00", "3/21/2019 7:59:00", "3/21/2019 7:58:00"))

(Steve Coile) #9

I have some concern that your posts use the fancy quotation marks. In the past, I’ve noticed others have had problems using fancy quotes in expressions. You might try disabling “smart quotes” and replacing the ones already there with non-fancy ones.

(Rpd Mobile Apps) #10

Hi @Steve

Yes min(list(“3/21/2019 8:00:00”, “3/21/2019 7:59:00”, “3/21/2019 7:58:00”)) returns the correct value. The error happens when the parameters are taken from column values and the equality sign is added to make a conditional test. One thing to note here is that when comparing DateTime values exclusively (ex. DateTime1 = DateTime2 ), the output is logically correct. However when applying the whole expression that uses MIN(), LIST() and equality sign (=), the output is always true.

1 Like
(Rpd Mobile Apps) #11


Hi Steve!

I made the initiative of recreating the whole app project from scratch and the same expression works fine now. I do not know why the error still exists in the old app, but somehow the error does not bother in my new app anymore.

I hope you could help me in later concerns. Thank you

(Steve Coile) #12

Ugh. Well, I too have had problems that were fixed by recreating the app. I’m sorry it took that, :frowning: