Nested Conditional Logic

advanced-prototyping

#1

Hello all,

I am new to this forum so I apologize if this question has been asked a hundred times. Is there some way to create nested conditional statements? If not, is there a workaround that can accomplish the same thing without doing anything too crazy?

Thanks!


#2

Hi!

Sadly, you can’t create nested conditional logic. The workaround is tedious, especially if you are nesting multiple levels.

Assuming you want this (in nested conditional logic land):

if a is true
[INDENT]if b is true
[INDENT]-- do whatever if both a and b are true
if c is true
– do whatever if both a and c are true[/INDENT][/INDENT]

You can do this in Axure

if a is true and b is true
[INDENT]-- do whatever if both a and b are true
else if a is true and c is true
– do whatever if a and c are true[/INDENT]

Another method is to use the move-by “function call” to handle nesting - this could reduce complexity if nesting is deep:

If a is true
[INDENT]Move Hotspot “testA” by 0,0

– script of Hotspot “testA”
On Move
if b is true
[INDENT]-- do whatever if both a and b are true
else if c is true
– do whatever if both a and c are true[/INDENT][/INDENT]


#3

Awesome thank you! Hopefully nested conditional logic gets added soon, but your first option isn’t too inconvenient. I’m upset with myself for not thinking of using AND


closed #4

unlisted #5