With conditional logic, forms can dynamically display or hide fields based on user inputs. This feature empowers you to create more interactive and efficient workflows by customizing the form experience to align with each user's unique responses.

Single-value and multi-value lookup fields can be used to define conditions for other fields in your submission form.

To understand how to create and edit forms in Workflow Manager, refer to Using Workflow Manager.

Here’s an example that explains how you can add conditional logic to your form.

Build a form with conditional logic for a company that offers subscription services with multiple tiers (Basic and Premium) and optional add-ons. The form dynamically adjusts based on user input to ensure they see only the relevant options.

Step 1: Setting up the subscription tiers

  1. Select the library in which you wish to create a new form.

  2. Select Create New Form.

  3. Select the Dropdown field and add it to the form’s canvas.

  4. In the field settings for the Dropdown field, set the field name and the field ID. Let’s rename them based on this example as below:

    1. Name: Subscription Tier

    2. Field ID: Sub_Tier

      Setting subsciption tiers.gif

      (Optional) Turn on the Required Field toggle to ensure that this field’s value must be mandatorily entered by the user.

  5. Add two dropdown values, which are basically the tiers of subscription being offered. As mentioned above, the two tiers of subscription must be Standard and Premium. Edit the dropdown values as below:

    1. Value 1: ID: Standard; Label: Standard

    2. Value 2: ID: Premium; Label: Premium

      Add dd values.gif
    3. Re-order as required.

Step 2: Setting up the number of users who are going to avail the subscription

  1. Select the Number field and add it to the form’s canvas.

  2. In the field settings for the Number field, set the field name and the field ID. Let’s rename them based on this example as below:

    1. Name: Number of Users

    2. Field ID: Number_users

      Setting up the tier for number of users.gif


      (Optional) Turn on the Required Field toggle to ensure that this field’s value must be mandatorily entered by the user.

  3. Number format: Select either Decimal or Integer. For this example, let’s select Integer as the preferred number format.

  4. Set the minimum and maximum values for this field.

    Setting the number format and values.jpg

NOTE: After completing Step 2, select Create in the form canvas to create the form. This saves the form in the unpublished state and also helps you to save all the updates done till this point.

Step 3: Setting up the add-on options based on the subscription tier

To show optional add-ons based on the subscription tier selected, we must configure them as below:

  1. Add two Boolean fields to the form’s canvas. As per the example, we'll have to create one add-on for Priority Support and another for Advanced Analytics.

  2. For the first Boolean field, let’s edit the details:

    1. Name: Priority Support

    2. Field ID: Priority_Support

      Boolean field 1 for priority support.jpg
  3. In the field settings for the Boolean field, select Add next to Conditions. A dialog opens with the options to set the conditional logic.

  4. To ensure that users see the Priority Support add-on if they select either the Standard or Premium subscription, we have to set the conditional logic as below:

    If Subscriptions Tier <is one of> Standard or Premium <then show> Priority add-on
Conditional logic for priority support add-on.gif
  1. Select Save.

  2. For the second Boolean field, let’s edit the details:

    1. Name: Advanced Analytics

    2. Field ID: Analytics

      Boolean 2 field for Advanced analytics.jpg

  3. In the field settings for the Boolean field, select Add next to Conditions. A dialog opens with the options to set the conditional logic.

  4. To ensure that users see only the Advanced Analytics add-on when they select the Premium package, we have to set the conditional logic as below:

    If Subscriptions Tier <is one of> Premium <then show> Advanced Analytics add-on
Conditional logic for advanced analytics add-on.gif
  1. Select Save.

Step 4: Setting up a custom heading for the add-ons

As explained in this example’s introduction, we're setting up a subscription service form with optional add-ons. A conditional logic is required to be added here as it'll define how add-ons are made available to users based on the subscription tier they’ve selected.

  1. Select the Custom message field and add it to the form’s canvas.

  2. In the field settings for the Custom message field, edit the message and set the style.

    Setting up the trigger for add-ons.jpg
  3. In the field settings for the Custom message field, select Add next to Conditions. A dialog opens with the options to set the conditional logic.

  4. To ensure that users see the custom heading and the subscription options when they open a form, we have to set the conditional logic as below:

    If Subscriptions Tier <is one of> Standard or Premium <then show> add-ons
Conditional logic for the add-on trigger.gif
  1. Select Save.

Step 5: Editing the form’s properties and publishing the form

  1. For the add-ons to appear under the custom heading in the users' form based on the subscription selected, move the custom heading field above the add-ons.

    Re-ordering the custom heading field.gif

Here’s the final form with conditional logic that’ll be visible to users:

Conditional logic applied to a form.gif