# If-Then-Else

**URL:** <https://community.glideapps.com/t/if-then-else/10672>\
**Category:** Report a Bug\
**Created:** [June 11, 2020, 12:49pm UTC](https://community.glideapps.com/t/if-then-else/10672 "2020-06-11T12:49:21Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodrigo\_Serpa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rodrigo_serpa/32/8206_2.png) [@Rodrigo\_Serpa](https://community.glideapps.com/u/Rodrigo_Serpa)\
**Post date:** [June 11, 2020, 12:49pm UTC](https://community.glideapps.com/t/if-then-else/10672/1 "2020-06-11T12:49:21Z")

</div>

Hello,  
In this case here the function “If-Then-Else” with “IS EMPTY” "is not doing the exact opposite of what it should be?  
Is that a bug?

 ![bug_if_relation](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/b/b3eca729d2c4618f247a2754eb0c2423e398272e.png)

the problem appears in the next column, returning the values exactly where “IS NOT EMPTY” …

 ![if_bug](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/8/82d309e8dc8dee977ca8dcd6c8bb407f92641ef3.png)

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [June 11, 2020, 1:05pm UTC](https://community.glideapps.com/t/if-then-else/10672/2 "2020-06-11T13:05:24Z")

</div>

but I see the logic right and the result too.

Only 2 rows aren’t empty therefore, I can see 2 zeros (0) in your screenshot.

Saludos @Rodrigo_Serpa

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Serpa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rodrigo_serpa/32/8206_2.png) [@Rodrigo\_Serpa](https://community.glideapps.com/u/Rodrigo_Serpa)\
**Post date:** [June 11, 2020, 1:17pm UTC](https://community.glideapps.com/t/if-then-else/10672/3 "2020-06-11T13:17:25Z")

</div>

Thanks @gvalero, but I just put the other image of the problem, where it returns the opposite, where de rows IS NOT EMPYT…Do you know what could be wrong?

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [June 11, 2020, 1:25pm UTC](https://community.glideapps.com/t/if-then-else/10672/4 "2020-06-11T13:25:55Z")

</div>

Aja… I think I have seen what you mean. Let me check one of my APPs to show you the same problem and its workaround.

I will be back!

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [June 11, 2020, 1:46pm UTC](https://community.glideapps.com/t/if-then-else/10672/5 "2020-06-11T13:46:34Z")

</div>

@Rodrigo_Serpa

This was what I saw days ago with something similar to your case.  
At the beginning, my original logic was this:

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/c/ce312c9d4041dac3574ba46caebccf2418075f08.png)  
but it never worked fine and I supposed it was a bug.

Later, I exchanged the logic and parameters like this:

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/9/9b1c600301bcc4baf01ee19e9f51fb123fec3bc9.png)

… and everything works perfectly!. There is something wrong with IF-Then-Else component when the first **THEN field** is empty by default.

I think @Mark can see it and fix the bug quickly.

Feliz día!

---

<div class="post-metadata">

**Author:** ![Mark](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark/32/125_2.png) [@Mark](https://community.glideapps.com/u/Mark)\
**Post date:** [June 11, 2020, 1:58pm UTC](https://community.glideapps.com/t/if-then-else/10672/6 "2020-06-11T13:58:08Z")

</div>

@gvalero Sorry, I cannot reproduce this. Could you please share the app you’re seeing this on, and tell me exactly how to reproduce it?

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [June 11, 2020, 2:18pm UTC](https://community.glideapps.com/t/if-then-else/10672/7 "2020-06-11T14:18:43Z")

</div>

Sure @Mark

As soon as I come back to my house I will make a simple APP to help you.

The issue is when the **first** THEN field is blank using **Is Empty** as conditional.

Nos vemos

---

<div class="post-metadata">

**Author:** ![Mark](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark/32/125_2.png) [@Mark](https://community.glideapps.com/u/Mark)\
**Post date:** [June 11, 2020, 2:21pm UTC](https://community.glideapps.com/t/if-then-else/10672/8 "2020-06-11T14:21:01Z")

</div>

I tried that, and it worked as expected:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/7/7cda53e4293da7308bf0c7472e5e37d26ee9abcd.png)

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Serpa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rodrigo_serpa/32/8206_2.png) [@Rodrigo\_Serpa](https://community.glideapps.com/u/Rodrigo_Serpa)\
**Post date:** [June 11, 2020, 2:31pm UTC](https://community.glideapps.com/t/if-then-else/10672/9 "2020-06-11T14:31:11Z")

</div>

Hi Mark, in my app column I have 2 cases (like a “IF(AND(…”) and only when I put these 2 cases together the problem appears (exactly like the second image I put)

---

<div class="post-metadata">

**Author:** ![Mark](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark/32/125_2.png) [@Mark](https://community.glideapps.com/u/Mark)\
**Post date:** [June 11, 2020, 2:37pm UTC](https://community.glideapps.com/t/if-then-else/10672/10 "2020-06-11T14:37:41Z")

</div>

I can’t see what’s going on in your second screenshot because all the columns you’re using are obscured. You can move columns by dragging them on the header.

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Serpa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rodrigo_serpa/32/8206_2.png) [@Rodrigo\_Serpa](https://community.glideapps.com/u/Rodrigo_Serpa)\
**Post date:** [June 11, 2020, 2:53pm UTC](https://community.glideapps.com/t/if-then-else/10672/11 "2020-06-11T14:53:07Z")

</div>

Sure, now is clear.  
The condition is set "IS EMPTY"but the return are in rows IS NOT EMPTY

 ![bug_if2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/3/3afdcaa0ebc6adf5cdc82516203c0a57541fbf49.png)

---

<div class="post-metadata">

**Author:** ![Mark](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark/32/125_2.png) [@Mark](https://community.glideapps.com/u/Mark)\
**Post date:** [June 11, 2020, 3:01pm UTC](https://community.glideapps.com/t/if-then-else/10672/12 "2020-06-11T15:01:59Z")

</div>

Sorry, I don’t understand.

Your If-Then-Else column says

If `SELECT_COD` is empty, produce an empty value  
Otherwise, if `ANO` is `2019`, produce `RENT_ACM`  
Otherwise, produce an empty value

That seems to be exactly what it’s doing.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [June 11, 2020, 6:36pm UTC](https://community.glideapps.com/t/if-then-else/10672/13 "2020-06-11T18:36:12Z")

</div>

Hi again

Reviewing my APP now I can see my problem disappeared, everything is ok now but this issue was there 1-2 weeks ago. I was using 8 columns with that logic and none worked so I had to use an reverse logic as workaround and everything worked w/o problems.

Well, close this case!

Gracias @Mark

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Serpa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rodrigo_serpa/32/8206_2.png) [@Rodrigo\_Serpa](https://community.glideapps.com/u/Rodrigo_Serpa)\
**Post date:** [June 12, 2020, 11:32am UTC](https://community.glideapps.com/t/if-then-else/10672/14 "2020-06-12T11:32:11Z")

</div>

Hi Mark,  
As @gvalero wrote my app started to work well too. Even with DATA ok, the app for some reason used to do the opposite logic, but now it’s solved.  
Thanks!
