Using the New Builder?
Conditions allow users to skip or reveal screens and fields in the normal workflow if certain user defined variables are met.
Conditions
Conditions are If/Then statements that are configured in the Settings panel on the left side of the Legacy Builder, under the Field/Screen Condition drop down. When defining the condition for displaying a screen or field, the condition operates on the value of a field that has happened prior to the screen or field where the condition is being applied.
The condition can be based upon the alphanumeric value of the field or based upon whether a checkbox is checked or not.
Checkboxes are either "Equal" or "Not Equal" to one of the values sets below. "True" for checked and "False" for unchecked, etc. These values are not case sensitive.
- True or False,
- Yes or No,
- 1 or 2.
Alphanumeric Conditions, i.e. any field that is not a checkbox, respond to any word or number value, as long as the value is exactly the same if "Equal" or "Not Equal" conditions are used. The remaining conditions, listed below, are more flexible but "Equal" and "Not Equal" are case sensitive and very literal.
- = Equal,
- <> Not Equal,
- < Less Than,
- <= Less Than or Equal,
- > Greater Than,
- >= Greater Than or Equal,
- Contains,
- Does Not Contain,
- Starts With,
- Does Not Start With,
- Ends With,
- Does Not End With.
Additionally, "Contains" and "Does Not Contain" work with multi-choice fields so that the condition will still trigger, even if other choices are selected in addition to the condition value.
Conditional Field
Field Conditions affect individual fields at a time and must be configured on each field. The Field Conditions drop down is located between the Reference Data drop down and the More drop down in the Field Settings panel.
GoCanvas Tip
If multiple fields are conditional off one field, format one field with the correct conditions and simply Copy the field to quickly and accurately repeat the condition.
There are many examples of conditions in the wild, like when an online ordering form asks whether the Shipping Address is different than the Billing Address. If yes, than those fields are revealed to be completed. If no, those fields remain hidden and the user can continue the form.
- Select the field that you wish to hide or reveal to open Field Settings in the left panel. In the example above, the first field that needs a condition would be the Shipping Street Address.
- Expand the Field Conditions drop down and select + New screen condition.
- The Condition Screen is the screen where the Condition Field is located.
- The Condition Field is the field that triggers the condition. In our example above, this could be a checkbox asking whether there is a different Shipping Address.
- The Condition is the determining circumstance under which the field will be revealed or hidden. Refer to the checkbox vs. alphanumeric condition tabs above to choose the right condition based on the condition field.
- The Condition Value is the field value that will trigger the condition. Refer to the checkbox vs. alphanumeric condition tabs above to choose the right value based on the condition field.
So this example may look like the condition box below. A checkbox, located on the "Customer Information" screen, with the question "Is the Shipping Address different than the Billing Address?" is posed as the Condition Field. The Condition is "Equal" and the Condition Value is "True" so that when the box is checked, the field is revealed.
The field will now have the blue branch icon to indicate that field is conditional. Now simply copy this field and rename it to copy the condition exactly, or repeat the above steps on all remaining Shipping Address fields.
Conditional Screen
When a form has multiple conditional fields that need to be triggered off one field value, a faster way to configure this scenario is to add all those fields to one screen and make that one screen conditional. That way, the mobile user will either reveal the screen or skip the screen entirely, saving time and reducing confusion as to which fields they need to complete or leave empty.
The Screen Condition(s) drop down is listed as the last drop down in the Screen Settings panel.
Taking the example above, a much faster way to configure these fields would be to add them to their own screen and add the condition to the screen instead.
- Select the name of the screen you want to make conditional to open Screen Settings in the left panel.
- Expand the Screen Condition(s) drop down and select + New screen condition.
- The Condition Screen is the screen where the Condition Field is located.
- The Condition Field is the field that triggers the condition. In our example above, this could be a a single choice button asking whether there is a different Shipping Address with the choices "Yes" and "No."
- The Condition is the determining circumstance under which the screen will be revealed or hidden. Refer to the checkbox vs. alphanumeric condition tabs above to choose the right condition based on the condition field.
- The Condition Value is the field value that will trigger the condition. Refer to the checkbox vs. alphanumeric condition tabs above to choose the right value based on the condition field.
So this example may look like the condition box below. A single choice buttons field, located on the "Customer Information" screen, with the question "Is the Shipping Address different than the Billing Address?" is posed as the Condition Field. The Condition is "Equal" and the Condition Value is "Yes" so that when the "Yes" button is selected, the screen will be revealed when the mobile user continues to the next screen.
The screen will now have the blue branch icon to indicate that entire screen is conditional.
More than One Condition
You can add multiple conditions to a single field or screen. These conditions are separated by "Or," if either field can trigger the condition, or "And," if both fields are needed to trigger the condition. For our example above, if the Shipping Address is actually a PO Box, there would be two conditions separated by "And" because only if the Shipping Address is different and it is a PO Box would the PO Box field be revealed.
Let's take a look at an alternative example using demographic information. Perhaps a form has a section dedicated to retirees or clients over 60. Only those who are retired or are over 60 years of age need to complete a certain set of questions on a conditional screen.
- Select the name of the screen you want to make conditional to open Screen Settings in the left panel.
- Expand the Screen Condition(s) drop down and select + New screen condition.
- Follow the steps above to add the first condition, selecting the Condition Screen, Condition Field, Condition, and Condition Value based on a field indicating the person completing the form is a retiree.
- Select + New screen condition and expand the drop down containing "And" to select "Or."
- The second condition will be based on the person's age so we will be using the condition >= Greater Than or Equal to. To guarantee this condition works, the Condition Field needs to be a Number field type.
- The Condition Value is 60. Below are both conditions separated by "Or."
Please Note
Combining multiple conditions can be tricky and may not work exactly as intended if there are too many conditions tacked onto one field or screen. Be sure to test before publishing to your team and overall keep the amount of conditions on one field or screen to a minimum.
Did we answer your question?
Please let us know by voting below. All we ask is if you downvote, please let us know how the content can be improved in the comments!
Comments
0 commentsPlease sign in to leave a comment.