IF not giving the correct result when checking numeric (integer) values

My app’s URL: glidecalculator.glideapp.io

I noticed a couple issues with my calculator app. One is that some of the button (tiles) actions are not responding anymore. From what I can tell, it’s just the number buttons. I’m still digging into that and trying to decipher my own logic, so I’m not sure if it’s related yet or not.

The other thing I’m noticing is that the IF result is not the correct result. I’m not sure if it’s related to any of the recent updates or if it started to happen prior to that. It’s been a few weeks since I have used the app. If you look at the image below, the very first case in this IF checks if the value in ‘Button’ is not π. None of the button values with numbers in them should equal pi, so the result should be *blank. (This isn’t just related to pi. Several of my IF columns are doing the same thing.)

This seems like it may be an integer vs. string comparison issue. Is Glide doing something different with integers now? Seems if I add add a character then the IF works correctly.

image

My first guess is that this may be causing my first issue in the calculator where the number buttons do not respond.

Is anybody else seeing this? If needed I can submit a ticket.
@Mark

1 Like

Yes, that’s clearly a bug. We’ll fix it. Thank you!

3 Likes

@Jeff_Hager @Mark I just bumped into something similar, but with dates.

It appears as though now when used in a math column is actually behaving as today (or at least, being recognised as today when subsequently used in an if-then-else)

Here is a simple example:

  • ts: Basic Time Column
  • mth-now: Math column using Now
  • ite-has-expired: If-then-else column that returns true if the timestamp is in the past

Here is what it looks like:

mth-diff-mins is just calculating the difference in minutes between now and the timestamp, to make it visually easier to see which ones are wrong.

With the two rows that are incorrect, the thing they have in common is that whilst the timestamp is in the future, it is still within “today”.

Here is the math column:

And here is what the if-then-else looks like:

:man_shrugging:

3 Likes

It’s not the Math column, but your If-then-else condition. “Is on or after” means it’s on that day, or a later day. This condition is true:

June 7 11:45PM is on or after June 7 10:13PM

If you want it to be false you have to use “is after”.

2 Likes

oh wow… that’s not how I would have expected it to work, but I guess it makes sense.

thanks!

1 Like

Geez, I think I should have known that, :man_facepalming: but didn’t catch it. I think ‘within’ and ‘on’ technically work the same way and include the whole day??? At least that’s how I think of it. There’s really no reason to have to check if something matches down to the second, so in this case only checking for ‘before’ or ‘after’ is sufficient…unless this is something unique to using Now() when comparing dates???

1 Like

It makes sense now that it’s been pointed out to me and I’ve thought about it a bit, and yeah before/after is perfectly adequate :slight_smile:

1 Like