Axure Docs
  • Axure RP Reference
  • Axure RP Tutorials
  • Axure Cloud Reference
  • Axure Support
  • Download

›Advanced Interactions

Installing and Activating RP

  • Activating Axure RP
  • Installing on macOS
  • Installing on Windows

Getting Started

  • Getting Started Video
  • The Axure RP Environment
  • Viewing and Sharing Your Prototypes
  • Keyboard Shortcuts
  • Auto-Saved Backup Files

Working with Widgets

  • Organizing Widgets
  • Widget Groups
  • Styling Widgets
  • Widget Libraries
  • The Grid, Guides, and Snapping

Basic Widgets

  • Buttons, Shapes, & Text
  • Images
  • Hot Spots
  • Lines & Arrows
  • Dynamic Panels
  • Inline Frames
  • Text Fields & Text Areas
  • Droplists
  • List Boxes
  • Checkboxes
  • Radio Buttons
  • Trees
  • Tables
  • Classic Menus
  • Snapshots

Working with Pages

  • Managing Pages
  • Styling Pages

Masters

  • Creating and Using Masters
  • Master Views
  • Raised Events

Introduction to Interactions

  • Events, Cases, and Actions
  • List of Events
  • List of Actions
  • Text Links
  • Style Effects
  • Animations

Advanced Interactions

  • Variables
  • Conditional Logic
  • Math, Functions, and Expressions
  • Selection Groups
  • Move Action Boundaries

The Repeater

  • Repeaters
  • Dynamically Adding Rows
  • Dynamically Deleting Rows
  • Updating Rows
  • Marking Rows
  • Sorting Rows
  • Filtering Rows
  • Pagination

Adaptive Views

  • Adaptive Views

Documenting Your Prototype

  • Page and Widget Notes
  • The Word Specification
  • Printing

Flow Diagrams

  • Flow Diagrams
  • Flow Connectors

Publishing Your Prototype

  • The Prototype Player
  • Customizing the HTML Output
  • Web Fonts and Font Mapping

Team Projects

  • Creating and Sharing Projects
  • Working with Team Projects
  • Team Project History
  • Troubleshooting Team Projects
  • Upgrading Projects to RP 9

Conditional Logic

Conditional logic is a system of rules you can use to specify when an interaction you've built should occur in the web browser. For example, you can stipulate that a button click will advance users to the next page in your prototype only if they have filled in all required fields in a form.

Think of conditions as having an if/then relationship with their interactions: if the condition is met, then the interaction will be executed.

You can create everything from simple conditions that affect only a single interaction to complex branching logic that controls every area of a prototype.

Building Conditions

To add conditional logic to an interaction, hover over the event name and click Enable Cases. In the Condition Builder dialog that appears, click Add Logic.

In the Condition Builder, you can configure one or more conditional statements using the fields in each row. A conditional statement compares two values in some way to produce a true or false result:

One value — How it compares to — A second value

For example, you can verify that a text field has been filled in with a particular value with the following condition:

text on widget — Text Field — equals — text — your value here

This conditional statement evaluates to true when the target text field's entered text equals the value provided in the rightmost field.

Satisfying "All" or "Any" Conditional Statements

When you set up multiple conditional statements for a case, you can decide whether the case gets executed when all the statements evaluate to true or when just any one statement evaluates to true. You can control this in the dropdown at the top-right of the Condition Builder.

Events With Multiple Conditional Cases (IF and ELSE)

When an event has multiple cases under it, you can use conditional logic to determine which of them will be executed in the web browser. You do this by building IF / ELSE chains.

IF / ELSE chains are made up of conditional cases whose conditions depend on one another. Each condition in the chain will only be evaluated if the previous condition "fails" by evaluating to false. Once a condition "passes" by evaluating to true, the prototype will stop evaluating further conditions in the chain.

For example, the submit button for a login form might have two conditional Click or Tap cases that do different things depending on whether or not the user has provided valid login credentials.

If the Email and Password fields both contain the correct values when the button is clicked, the first condition will evaluate to true and its case will be executed, opening the Account Dashboard page. The second case will not be evaluated at all.

If, however, one of the two fields doesn't contain the correct value when the button is clicked, the first condition will evaluate to false and its case will not be executed. The prototype will then move on to the second case and evaluate its condition. The second case has no condition, so it gets executed by default, and the error message is displayed.

Tip

Placing an ELSE IF true case (one with no condition) at the end of an IF / ELSE chain is a common way to create a catch-all or "default" case that will always be executed when all other conditions in the chain above it fail. Don't put any other ELSE cases after it, though — their conditions will never be evaluated since the ELSE IF true case evaluates to true automatically.

The example above is fairly simple, but you can add as many ELSE cases to a chain as you like. For instance, the Click or Tap event above could include another ELSE case, above the one for the error message, that opens an administrator user profile when you log in to an admin account. The error message would only be displayed if incorrect credentials were entered for both the admin and non-admin accounts.

Creating Multiple IF / ELSE Chains

By default, the first conditional case under an event is the IF case, and all following cases are ELSE cases in the IF / ELSE chain. You can create additional IF / ELSE chains by changing ELSE cases into IF cases. To do so, right-click a case name and select Toggle IF / ELSE.

IF cases' conditions are always evaluated in the web browser, and each IF case starts its own IF / ELSE chain. Create multiple chains when you want to evaluate multiple conditional criteria independently of one another.

For example, the submit button for a signup form might have two IF / ELSE chains under its Click or Tap event, one that that determines whether the user has opted to sign up for a newsletter and a second determines whether the user has filled in all required fields.

If the Newsletter Checkbox is checked when the submit button is clicked, the first case's condition will evaluate to true, and the NewsletterVar variable's value will be set to "true."

The second case's condition will then be evaluated regardless of the outcome of the first case. If the user has filled in both text fields, the condition will evaluate to true, and the user will be directed to the Account Setup page. The third case's condition will not be evaluated because it is an ELSE case in the second case's IF / ELSE chain.

However, if one or both of the text fields is blank, the second case's condition will fail, and the prototype will move on to the third case, which shows an error message.

← VariablesMath, Functions, and Expressions →
  • Building Conditions
    • Satisfying "All" or "Any" Conditional Statements
  • Events With Multiple Conditional Cases (IF and ELSE)
    • Creating Multiple IF / ELSE Chains
Axure Docs
Stay Connected

Sign up to receive Axure tutorials and news. You can unsubscribe at any time.

Axure
TourEnterpriseCompanyDownloadPurchase
Legal
Customer AgreementPrivacy PolicyGDPRSecurityPatents
Resources
BlogForumLicense PortalAxure Cloud
Support
Learn and SupportGetting StartedReferenceWidget LibrariesAxure RP 8 Documentation and Tutorials
Copyright © 2002–2021 Axure Software Solutions, Inc. All rights reserved. Axure® is a registered trademark of Axure Software Solutions, Inc.