How to use conditional branching (skip logic)
Mobile apps built with Canvas allow users to skip screens in the normal work flow if certain user defined conditions are met. This skipping of screens is called "conditional branching". It is sometimes called "skip logic", too. This simple video overview reviews the conditional screen and list functionality of Canvas.
How Conditional Branching works
The condition for displaying a screen is set on the properties settings for a screen under the Condition section (see screenshot below for an example). When defining the condition for displaying a screen, the screen condition operates on the value of a field that has happened prior to the screen that has the condition associated with it. The condition can be based upon the value of the field, or based upon whether it is checked or not (if it is a checkbox control). If it is based upon a checkbox control, the values to be used should be "True" or "False".
How to set up a conditional screen
An example of conditional branching can be seen in an example application used to gather demographic information about people. On the first screen called Basic Information a checkbox exists called Retired. If the checkbox is checked we want a second screen to be shown called Retiree Information which contains questions specific to a retired person. If the checkbox is not checked, we do NOT want to show the Retiree Information screen.
Example Demographic Information Application Layout
Follow the steps below to make the Retiree Information screen conditional on the Retired checkbox field:
- Edit the screen you want to make conditional, in this case Retiree Information.
- Click on the Condition drop down menu.
- Select a Condition Screen. Choose the screen that has the field you want your Conditional Screen to depend on. For this app, select Basic Information.
- Select a Condition Field. This is the field that will be looked at to decide whether or not your Conditional Screen will be displayed. Choose the checkbox field, Retired.
- Finish the condition by putting in the Condition Value and Condition. The Condition Value is the value your Condition Field will be compared to. The Condition will be equal, not equal, less than, greater than, less than or equal to, or greater than or equal to. In this app we want our conditional screen (Retiree Information) to show if the checkbox (Retired) is true.
- Once you’ve done that hit Done. Don’t forget to save and publish your app!
In summary, conditional branching allows your mobile users to skip screens if certain predefined conditions are met. It is set under the Condition section of a screen based on the value of a field.
If you have any questions about Canvas or need help replacing paper based forms with an Android or Apple device, please don't hesitate to contact us.