# Multiple show/hide based AND and OR conditions, Can someone explain how to?

Hi all, I am sure my question was asked before but I could not find any specific answers that helps.

I am asking my users to fill numbers in orders to proceed to the next tab (Number entry).
For example:

1. What is your First score?
2. What is your Second score?
The conditions are:
3. If: the answer of 1 is >= 92 AND <= 100
AND
The answer of 2 is >= 60 AND <= 99
THEN :Show Next BUTTON.
4. If: the answer to 1 is >=90 AND <=91
AND
The answer of 2 is >= 60 AND <= 99
THEN: Show X massage.
5. If: the answer to 1 is <=90 AND >=80
OR
The answer of 2 is >=140
THEN: show Y Button.
6. If the answer to 1 is <=79 AND >=0
OR
The answer to 2 is <=50 AND >=0
Then: Show massage “out of range”.

I tried :

1. If->then->else = I could not find AND conditions.
2. Show/Hide components = > Could not find more then 1 AND for same component.

But is the solution for this?
Thank you.

First, I am going to say: Vote for This Feature!!

Then you need to understand the current way an If-Then-Else (ITE) column works is by selectively eliminating possibilities one by one.

You may need multiple ITE columns to whittle down your possibilities.

For example, one ITE column to evaluate answer 2 and put the results into a “bucket”

If answer 2 is >= 140 then “Y”
if answer 2 is <= 50 then “R”
if answer 2 is > 99 then “A”
if answer 2 is < 60 then “A”
else
“X”

Then pare down answer 1 in the same way.
If answer 1 is > 100 then “R”
If answer 1 is <= 79 then “R”
If answer 1 is <=90 then “Y” (by now we know it is also 80 or greater)
if answer 1 is >= 92 then “3”
if answer 1 is >= 90 then “4”
else

My point is (and I probably messed up somewhere), but you do have conditions for <=90 on question 1 in one spot and >= 90 in another spot, so you need to resolve that conflict.

Then you’ll have a third ITE column to further whittle things down, remembering that once a branch is taken no other branch is looked at.

2 Likes

This is now I would set up a single IF column to handle these conditions. Hopefully it covers all conditions. I’m assuming Answer1 only has a range of 0 to 100. I’m not sure what the proper range is for Answer2. Anywhere I have ??? means I didn’t know what you want to happen when you have an Answer2 that’s less than 60 or greater than 99, but less than 140, or none of your conditions are met. For each THEN, I’m just putting what you would want to see, but in reality you would use that result for a visibility condition. Like @David_Gabler pointed out, you have a conflict with 90 in two spots. I made the assumption that it should be 89 in your 5th point above, but if it really should be 90, then you can change what I have for 89 below to be 90 (which may actually mean that what I came up with below, may not work correctly because of the conflict).

``````
IF Answer1 <= 79 THEN 'Out of Range'

ELSEIF Answer2 <= 50 THEN 'Out of Range'

ELSEIF Answer1 <= 89 THEN 'Y'

ELSEIF Answer2 >= 140 THEN 'Y'

ELSEIF Answer2 < 60 THEN ???

ELSEIF Answer2 > 99 THEN ???

ELSEIF Answer1 >= 92 THEN Next

ELSEIF Answer1 >= 90 THEN X

ELSE ???

``````

Also consider that there is a javascript column that you can use to write more robust IF conditions using javascript. It would be a little easier without having to twist your mind around to accomplish it using Glide’s IF column.

2 Likes

Thank you both,
I have tried both your solutions (and other solution by me) but with no luck, it does not work.

At the end I am stuck with more conditions.
The END conditions should be:
If :

1. ANSWER 1 is NOT OK (>100,<80) AND ANSWER 2 IS NOT EMPTY
OR
2. ANSWER 2 is NOT OK (> user input AND <50) AND ANSWER 1 IS NOT EMPTY
AND
3. user status is H , THEN- > SHOW text, else, show button.

I did manage to achieve 1 as a standalone , and 2 as a standalone.

I did not mange to achieve (1OR2)AND3, Is there a solution for this?
Is is possible to solve it by doing it completely using JAVASCRIPT? If so I will hire expert for this.

Thank you.