Support for Nested Conditional Logic?

advanced-prototyping

#21

This is nice indeed, but this way it is still not possible to check some condition, do something, then check another condition and do something extra.


#22

So did this ever get put in? I think the problem is that you have conditional logic for 1 action.

For example, in the above examples if something and some or something, then do THIS. What I want is something more like this (specifically adding filters to a repeater):

Case 1 - Check values for column 1

  • If column 1 = A, then add filter A
  • If column 1 = B, then add filter B
  • If column 1 = C, then add filter C
    Case 2 - Check values for Column 2
    (IF)
  • If column 2 = D, then add filter D
  • If column 2 = E, then add filter E
    Case 3 - Check values for Column 3
    (IF)
  • If column 3 = F, then add filter F

And I want this to be cumulative. Basically this reads checkbox toggles (true/false). I want to be able to set column 1’s value to A and have the repeater be filtered by that.

Then I want to go back and set column 1s value to A and C and column 2s value to D.

It should show me all rows where [column 1 = A AND column 2 = D] OR [column 1 = B AND column 2 = D]
and my results would look like
A D
A D
B D
A D
B D
B D

Currently when I try with a bunch of IF statements, because I can’t nest, and I need the filters to be cumulative, it tries to show me the rows where Column 1’s value is BOTH A AND B, which is impossible, so it returns a blank table.

My only other option is to do a bunch of Else Ifs but then the logic will stop as soon as it sees a row where column 1’s value is A and process no more, as far as I can tell. If I could nest the Else Ifs within a single case I think that might solve my problem.


#23

So did this ever get put in? I think the problem is that you have conditional logic for 1 action.

For example, in the above examples if something and some or something, then do THIS. What I want is something more like this (specifically adding filters to a repeater):

Case 1 - Check values for column 1

  • If column 1 = A, then add filter A
  • If column 1 = B, then add filter B
  • If column 1 = C, then add filter C
    Case 2 - Check values for Column 2
    (IF)
  • If column 2 = D, then add filter D
  • If column 2 = E, then add filter E
    Case 3 - Check values for Column 3
    (IF)
  • If column 3 = F, then add filter F

And I want this to be cumulative. Basically this reads checkbox toggles (true/false). I want to be able to set column 1’s value to A and have the repeater be filtered by that.

Then I want to go back and set column 1s value to A and C and column 2s value to D.

It should show me all rows where [column 1 = A AND column 2 = D] OR [column 1 = B AND column 2 = D]
and my results would look like
A D
A D
B D
A D
B D
B D

Currently when I try with a bunch of IF statements, because I can’t nest, and I need the filters to be cumulative, it tries to show me the rows where Column 1’s value is BOTH A AND B, which is impossible, so it returns a blank table.

My only other option is to do a bunch of Else Ifs but then the logic will stop as soon as it sees a row where column 1’s value is A and process no more, as far as I can tell. If I could nest the Else Ifs within a single case I think that might solve my problem.


#24

Also +1’ing this as something that would be a huge plus to have in Axure. Working around this hasn’t been fun.


#25

I’m a plus one as well. Well, at least the ability to mix and and or conditions. Not sure if that’s nested conditions, exactly, but from a GUI perspective, it would be nice to have the following capability:


Just make the AND/OR at the line level instead of the top level.

[later] I thought about it more, and do understand nested logic, and yes, it would be nice not to have to have work around this with variables and moving invisible panels by 0 pixels.


#26

That works to an extent but gets confusing. Lets say you added another line to your example. If ‘or’, what is it an option of? The ‘or’ above it or the ‘and’?

but I agree this could be handled in the GUI in some way, and would be a great feature.


#27

True. I haven’t thought of all the use cases, but you could make it hierarchical, so you can set your “All/Any” for the overall condition, then within each of those main boxes offer an or/and option for individual widget states. Just a 2-level hierarchy like that might not solve everyone’s complex logic designs, but would certainly address anything I’ve every attempted.


#28

If it counts for anything, I am a new user and my first attempt at using variables requires a nested condition.


#29

I concur with the need for nested conditions! It can be done with very long and repetitive condition statements, but would be far easier to read and maintain if we had nested conditions.

thanks for your consideration.


#30

It could be done like this, where the conditions are put in as sub-cases or something and then indented


They could be dragged around and another line colour added (say green) for sub-positioning, (not red or blue) as per current.


#31

It would remove so much repetition and be great :thumbup:


#32

I’m really looking forward to that feature as well!


#33

Quite unbelievable that after almost 3 years, a much requested feature still haven’t been developed. Is it really that much to ask?

I run into the problem of not having nested if statement in my first Axure project too. Something as simple as [IF… IF…] instead of [IF… ELSE IF…] is very much needed.


#34

The idea behind nested logic is to put if statements within if statements. As in, “If the sun is shining wear a hat and check outside. If there are now clouds remove the hat; Else if the sun is bright also put on sunglasses.”

The way you describe it, I’m not sure you are actually looking for nested logic. I think what you need to do is right click on the second of your cases and select to ‘Toggle If/Else If.’

[EDIT] Also, regarding your username - If you think that, don’t use it. Your choice. Nobody likes a Moaning Myrtle…


#35

another vote for nested conditionals!


#36

I don’t use nested conditionals frequently. But, it would be great to have nested conditionals for those times that I do.


#37

I’m running into issues because I’m having to build out combinatoric cases instead of simple nested ifs. Would love to raise the visibility of this feature request as much as possible.


#38

Yes, voting for this. First project and I can’t do a simple loop, my logic always stops at the first IF statement and then my UI fails.


#39

+1 for this feature


#40

This request/thread has been running for 4 years!
I really need nested conditional capabilities from Axure.
Is there any sign of this function being delivered and if so when?