This article provides basic information about Conditions in the Builder as well as guided steps for using more than one condition to trigger a screen or field.
Combining multiple Conditions allows for more specific parameters for hiding or revealing fields and screens.
Conditions
Conditions are If/Then statements that are configured in the Field Settings in the left panel, under the Conditions menu. When defining the condition for displaying a field, the condition operates on the value of a field that has happened prior to the 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 "Checked" or "Unchecked."
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.
*Click the gif to expand.
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.
GoCanvas Tip
Conditions can also be based off blank values.
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 in the article, "Screen Conditions in the Builder," 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 screen that you wish to reveal or hide to open the Screen Settings in the left panel. In our example, this is "Retiree or Senior Citizen."
- Expand the Conditions menu and click Add Condition.
- Expand the Field drop down where you will first answer the question, "What screen is the field in?" In our example, this is "Client Information."
- Next, Choose the field that triggers the condition. In our example, this is "The client a retiree?"
- 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. In our example, this is = (Equal).
- The 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. In our example, this is Checked.
- Click the checkmark to save the condition.
- Click Add Condition and click Or to toggle the setting because this screen is not contingent on both conditions being met.
- The second condition will be based on the person's age so we will be using the condition >= Greater Than or Equal. To guarantee this condition works, the Condition Field needs to be a numeric field type (i.e. Calculation or Number). In our example, this is "Age in Years" on the "Client Information" screen.
- The Condition Value is 60.
- Click the checkmark to save the condition.
In summary, when the user checks the Checkbox field labelled "Is the client a retiree?" OR the clients age is Greater than or Equal to 60, then the screen "Retiree or Senior Citizen" will appear as the next screen for the user to complete.
The screen will now have the branch icon to indicate that field is conditional.
Save and Test your condition to be sure they work as expected, either from within the Builder or Publish to test on mobile.
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?
We'd really appreciate your feedback! Please leave your suggestions for improvement in the comments or let us know what you're looking for so we can assist you better. We want to help, but we need to understand your needs!
Comments
0 commentsPlease sign in to leave a comment.