Multiple (IF AND), and multiple (IF OR), How to do that?

Kindly, i need to filter a dependent dropdown list at form. i am using filter located under Option tab.

It is allowing one condition (AND, OR) multiple conditions. However, i have three condition using (AND)
as well as another condition using (OR)

for example: i need to filter the dropdown when the follows occurs:

Owner=onscreen Owner
AND
Company=onscreen Company
AND
(Project=onscreen Project OR Project=userprofile Project)

is it possible to do that? if Yes, Please how?

Thank you

For complex conditions like this, it’s usually better to define the logic in the Glide Data Editor.

I would do something like this:

  • Ensure your first choice component is writing to a User Specific Column
  • Apply the selected value to all rows using a Single Value column
  • Then use an if-then-else column to identify matching rows. With complex logic like that you describe, the trick is to work backwards by progressively eliminating those rows that do not match. For your example, something like the following should work:
    – If Owner is not onscreen Owner, then false
    – If Company is not onscreen Company, then false
    – If Project is onscreen Project, then true
    – If Project is userprofile Project, then true
  • You can then filter your second choice component to only include those rows where the if-then-else column is true
3 Likes

Really Thank you Darren, for your continues support and encouragement.

I will try to implement this approach and, if you pleased, i will come beck with feedback.

the “onscreen” is the values selected from the user on dropdown choice component. i used the Glide terminology, Can i use those values in if-then-else column? sounds not possible to me, but i will give a try.
Thank you

Hola @Hani_Ibrahim

If I were you, I’d use a solution like it shown here SUMIFS and advanced formulas - #5 by gvalero

but I know that there are conditions or knowledge that make it hard to understand and carry out.

In these cases, when there are multiple AND/OR conditions (the problem get worse if there are AND/OR combinations) the solution can be long and not efficient. If we have to create new columns to get True/False values in each one we are going to hold/handle too many values (rows) and the APP performance can be affected.

Let’s assume your raw table has 5.000 rows and you are going to create 4-5 new columns (If-Then or Math) to get True/False values and be used as filters. After this, your APP will hold now 25k new rows (True/False values) to work as filters and to me, it’s something inefficient, not worth it!

Maybe it’s the “no code” solution that most want to use and love but it’s not optimal, you are loading “dead weight” on your APP unintentionally. Again, to me in these cases, the better idea is use a JavaScript code which sometimes, it can be very simple and easy to understand.

Saludos!

2 Likes

Hola @gvalero

i love the straight forward decisions :clap:

i have many heavy dead loads on my shoulder already :grinning: jumping from no code platform to another no code platform, learning and spending considerable time and effort to learn then trying to implement what i learned to achieve my life project.

However, i did find a work around by taking a step back and readjust the logic itself to avoid passing through many extra columns.

Thank you for your kind reply. :pray:

1 Like

Great decision!
Sometimes we need to go back to fix errors and look at better the way we are going to walk!

Feliz día!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.