Add Conditional Logic to a Form

Conditional Logic uses “If This, Then That” statements to add intelligent automation to forms. Conditional Logic defines how form elements behave based on input from a mobile user. For example, based on the answer to one question, other questions might be hidden, shown, required, cleared, or assigned a specific value. This topic describes how to build Conditional Logic rules into a form.

Available on the Advanced and Enterprise tiers:

Essentials
Advanced
Enterprise

Contents

Video

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. Select Conditional Logic > Add a Rule.

    Select "Add a Rule" in the Form Builder

  4. Enter a Rule Name (required) and Rule Description (optional).

    Rule Name and Description fields

  5. In the If statement, define the condition that must be met to trigger the actions. This might be a specific answer to a single question or a combination of answers to multiple questions.

    Fields for an "If" statement

  6. In the Then statement, define what the form should do when the If statement is true. You can show or hide pages and sections and show, hide, require, clear, or assign values to questions.

    Fields for a "Then" statement.

    Some Conditional Logic rules have multiple Then statements. If your rule has a long list of Then statements, organize the statements to run in a logical order. To move a Then statement, select the handle to the left of the statement and drag the row to a new place.

    A list of Then statements in a Conditional Logic rule. Select the handle on to the left of a Then statement and drag it anywhere in the list.

    You can also add a new Then statement anywhere in the list. Hover between two Then statements and select the plus sign [+] to add a new statement.

    A list of Then statements in a Conditional Logic rule. Hover between two statements, and select the plus sign [+] to insert a statement.

    Info:The topic Best Practices for Conditional Logic Rules describes the benefits of reordering Then statements in more detail.

  7. Else statements define what the form should do when the If statement is false. The form automatically builds Else statements that undo the Then statements.

    (Optional) To add, change, or delete one or more Else statements, select Custom Actions.

    Fields for an "Else" Statement

  8. Save the form.

    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.