Conditional logic swallows other interactions

I’ve added conditional logic to the Page Loaded interaction on my form and find that now all other interactions not belonging to that logic are assumed under it. I’ve tried to move them out of the conditional grouping but to no avail. Any suggestions?!

In other words, I want the conditional logic to set the greeting on the screen to ‘Good morning’ or ‘Good afternoon.’ All other interactions are the same regardless of morning or afternoon. Must they also be in a conditional group? Is there simply an Else?

image|228x500

Conditional cases can have “IF” or “ELSE IF” logic. The default is “ELSE IF” which I’ve found is not what I need about 80% of the time. If you right/alt-click a case you can change this with the “Toggle IF/ELSE IF” setting. If there is something else particular to your issue, it is much easier to help if you post your .rp file.

Here is the Axure documentation for conditional logic:

Thanks for the response. Toggle:nice feature. I am still, however, unable to isolate other interactions on the page from the conditional cases. I wonder if this is per design or a worthy enhancement request.

Not clear what you mean by “isolate other interactions” … a picture is worth 1000 words and an .rp file is worth 10,000. If you post your .rp file, your fellow users here can most likely help. Or, you can send it to support@axure.com and they might be able to help.

Good point!


I want the page to greet the user depending on morning or afternoon. I’ve created cases based on [[ Now.getHours() ]] i.e. <12=‘Good morning’, >=12=‘Good afternoon’. The other Move and Set Text interactions have nothing to do with the greeting. I want them to be outside of the conditional cases.

I’ve uploaded the rp file here… https://b3en2r.axshare.com

So there it is… 11,000 words.

@MollyB,
I still can’t access your .rp file, only your published HTML. But, your screenshot helps. In this situation you’d have at least three conditions to handle, thus three conditional cases:

  • Case 1: System Greeting Morning
    If [[Now.getHours()]] is less than “12”
    • Set Text system_greeting …
  • Case 2: System Greeting Afternoon
    Else if [[Now.getHours()]] is greater than or equals “12”
    • Set Text system_greeting …
  • Case 3: Always
    If True
    Move …
    Set Text …
    Set Text …
    etc. …

The key thing is the “Always” case needs to be an “IF” and not an “ELSE IF” and have no conditional logic (thus it results in “If true” …and logically, “true is always true”)

  • You could make it the first case, which automatically sets it as an “IF” case. This works fine and usually makes more sense. Just ensure the second case is and “IF” and not “ELSE IF” because the latter equates to “ELSE IF true is not true” which is impossible, so it would never get triggered.
  • Realize that all “ELSE IF” cases are ordered and get triggered in the order you set them, but all “IF” cases are unordered so you have no control over when they get called by the browser. So, in my example above, the “Case 3: Always” would not necessarily happen after Case 1 and Case 2. Usually this doesn’t matter, but let’s say you needed to do something different in Case 3 based on the results of Case 1. You’d need to rethink the logic, possibly duplicating actions in Case 1 and Case 3.

FYI, Uploading .rp files works the same as for images, look for the little “up arrow” icon in the Reply editor, or drag in a file from an explorer window:
image

Thanks for the explanation. I hadn’t thought of another ELSE for the always true cases. I’ll give it a go. And thanks also for the uploading tip.

Molly

Me again. I tried it but find I cannot create a second IF within the same Interaction. It’s always Else IF if not the first one. So either the greeting works and not the Always actions, or the Always works and not the greeting.

The rp file is too big to upload here so I’ve created a project here where you can download it…(Axure Cloud)

Further explanation…


Hi, MollyB. If you right-click on the IF or ELSE in the interaction pane, the contextual menu has an option: “Toggle IF/ELSE IF” that should do what you hope to do.

Jeff

That did it! :grinning: I forgot about the toggle.

Thanks.