How to Add Conditions in the Legacy Builder

Have more questions? Submit a request

Conditions allow users to skip fields and screens in a submission if specific criteria 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.

Checkbox Conditions Alphanumeric Conditions

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.

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.

LB_Field Settings_Conditions.png

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.

  1. 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.
  2. Expand the Field Conditions drop down and select + New screen condition.LB_Field Settings_Field Condtions_Expanded.png
  3. The Condition Screen is the screen where the Condition Field is located.
  4. 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.
  5. 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.
  6. 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.

LB_Field Settings_Field Condtions_Completed.png

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.

LB_Screen Settings_Conditions.png

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.

  1. Select the name of the screen you want to make conditional to open Screen Settings in the left panel.
  2. Expand the Screen Condition(s) drop down and select + New screen condition.LB_Screen Settings_Screen Conditions_Expanded.png
  3. The Condition Screen is the screen where the Condition Field is located.
  4. 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."
  5. 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.
  6. 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.

LB_Screen Settings_Screen Conditions_Completed.png

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. 

  1. Select the name of the screen you want to make conditional to open Screen Settings in the left panel.
  2. Expand the Screen Condition(s) drop down and select + New screen condition.
  3. 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.
  4. Select + New screen condition and expand the drop down containing "And" to select "Or."
  5. 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.
  6. The Condition Value is 60. Below are both conditions separated by "Or."LB_Screen Settings_Screen Conditions_Multiple Conditions_Or 1.pngLB_Screen Settings_Screen Conditions_Multiple Conditions_Or 2.png

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. 

Articles in this section

Was this article helpful?
10 out of 20 found this helpful
Share

Comments

12 comments

Please sign in to leave a comment.

  • Does it follow an order of operations if there are multiple "OR" and "AND" used?

    0
  • Hi Chris,

    It goes in the order of the condition, so the first condition in the list will go first, then the second, etc. 

    0
  • For conditional fields, suppose I have a field that may or may not get information dispatched into it. If information is not dispatched, I do not want the user to enter any information into that field. So, I have it set as "Read only". However, If I want to set up a condition for another field to pop up based upon that field being empty or blank.. is there a text 'value' for blank cells..  Similar to a checked or unchecked block using "TRUE" or "FALSE" as the value for the condition.. Can "TRUE" or "FALSE" be used against an empty short text or dropdown field? I have been using 'is equal to '0'. Seems to work.

    Are there any other "text"values that can be used? 

    Also, are there other characters that can be used similar to SQL %XYZ%.. or XYZ% to catch anything that contains or starts with XYZ? 

    (Edited )
    1
  • Hi Keith,

    You can also do is not equal to and then leave the condition value blank. 

    The things that work are: 

    True/False
    Yes/No
    1/0

    We don't have a wildcard (though there is a feature request for that: https://help.gocanvas.com/hc/en-us/community/posts/360015937774-Allow-use-of-wildcard-characters-in-field-conditions-to-reduce-quantity-of-field-conditions as well as for contains: https://help.gocanvas.com/hc/en-us/community/posts/360000480568-Add-Contains-To-Field-Conditions). 

    0
  • Great info! Thanks! Guess this answers Jason Good's original post above too. Sara is always watching. Lol.

    0
  • Is it possible to have field conditions show up only if boxes are checked within a multiple choice drop down? Specifically, I have to select certain items in a list. If they are selected, I want another option to show up on the app to enter the calibration date of the item selected within the drop down.

    0
  • Howdy Bob,

    You can set field or screen conditions based on user input for most field types, including Drop Down fields and Multiple Choice fields.

    Could you please share more specific details on your use case and the hurdles you have encountered when trying to set up Conditions? That way, other users in the Community can provide their insight on the matter.

    Alternatively, you can submit a ticket to our Support Team for direct troubleshooting with your App and any issues you may have encountered.

    0
  •  

    This is the multiple choice checkbox.

     

    If I select High Voltage Gloves, I want a new option for "Tested Date:" and if I choose Calibrated Meters and Test Equipment, I want a new option for "Calibration Date:" Currently i cannot choose those options as Yes/no, true/false or Greater than/equal etc. Am I suppose to use the CONTAINS function? If so, would it be the name of the option checked or something else? Thank you 

    0
  • Hi Bob, 

    Yes, in that case you'd use CONTAINS, and enter Calibrated Meters and Test Equipment. Then, even if users select that plus some other options, it should still trigger the conditional field. 

    0
  • The CONTAINS function worked perfectly. Thanks!

     

    2
  • Glad to hear it, Bob! 

    0
  • Hi,

    Is it possible to have a value in a field change depending on the condition - or using an alternative approach?

     

    Specifically, I am trying to build an expenses claim form.  The HMRC mileage rate is £0.45 per mile up to 10,000 business miles and then reduces to £0.25/mile above that.  I thought the most appropriate way to calculate this would be for the number of miles claimed to date to be entered by the user.  The person compiling their claim would then add each journey and the miles driven.  The app would check if the total number of miles in this month + previous claim is </> 10k.  Then the claim value can be calculated accordingly. 

     

    But, this requires a conditional IF(X<10000,0.45,0.25) or something along those lines.

     

    I hope this makes sense and thanks for your help in advance.

    -1