Add Conditional Logic to a Form

Available on the Advanced and Enterprise tiers:

Essentials
Advanced
Enterprise

Contents

About

Conditional Logic uses "If This, Then That" statements to add intelligent automation to forms, guiding users of a form through a workflow depending on their context. Read more general information about Conditional Logic.

This article discusses how to build Conditional Logic rules into your forms. These define how the mobile form behaves (what parts of the form are hidden, shown, required, etc.) based on the information provided by mobile users.

Add a Rule 

  1. Open the Form BuilderClosed The Form Builder is the tool that form designers use to create forms. In the Form Builder, accessed from the TrueContext Web Portal, form designers can add and edit pages, sections, and questions, as well as attach data destinations and configure the form's settings..

  2. Ensure you have created all the questions/sections/pages that will be involved in your Conditional Logic rule.

    Display of questions in a form

  3. Navigate to the Conditional Logic tab.

  4. Select the Add a Rule button in the left navigation bar.

    Select "Add a Rule" in the Form Builder

  5. Give your rule a unique name, and optionally a description. These will help you later identify what the rule is supposed to do in the form.

    Rule Name and Description fields

  6. In the If Statement, put together a test to check if a question meets certain conditions. The question you are checking is on the left, the operator is in the middle, and the thing you are comparing the question to is on the right.

    Fields for an "If" statement

  7. In the Then Statement, tell the form what to do if the If statement is true. The question, section, or page you want to act on is on the left, and the action you want to perform on it is in the middle.

    Fields for a "Then" statement

  8. The Else statement is what happens if the If Statement is NOT true. The form automatically builds one that is the opposite of your Then statement.

    Fields for an "Else" Statement

  9. If you want to customize or delete the Else statement, select "Custom Actions". Change or delete one or more of the Else statements.

    Tip:Else statements are optional—you can delete any or all of the actions. To delete an Else action, select Custom Actions, and then select the X next to the action.

    Custom Actions for an "Else" Statement

  10. Save the form and test it out on a mobile device to check that your Conditional Logic is working correctly.

    Note: To make sure your Conditional Logic rules work as intended in the field, test them thoroughly before you deploy the form. Test the form under a variety of conditions to validate the field user experience.