Contents
Overview
This article provides information and instructions to program administrators for creating conditional logic in forms.
Conditional Logic
When building a form, there are times when not all form fields should be available for every applicant to complete.
For example, if various sets of questions or form fields are required based on an applicant’s college major, the form would be too cumbersome and confusing if all sets of questions for all majors were shown to all applicants.
In instances where sets of form fields are contingent on a specific response, then conditional logic is used.
Conditional logic is available on all forms within a program cycle’s workflow, applies to single-select or multi-select form fields, and can reveal any other form field types when the conditions are met.
Please note that once a program cycle is published, new conditional logic cannot be added, and existing conditional logic cannot be edited.
Set Up Conditional Logic
To set up conditional logic on a form:
- With the form open, add and configure all form fields, including every field that is part of a condition. (Please see the articles titled Add a Form, Add a Form Field, and Configure Form Fields for more information.)
--- IMPORTANT ---
All form fields first must be added to the form before they can be applied to specific responses or conditions. In a field’s configuration panel, do not select “Hide” unless the field should be permanently hidden from the applicant; the “Hide” feature is separate from conditional logic.
One at a time, configure the conditional logic on form fields that should appear when a condition is met; the condition could be simple or complex. (Examples with steps are shown below.)
--- REMEMBER ---
When applicants preview an intake form with conditional logic, they will see ALL the form fields, including fields that do not show until specific conditions are met. When the applicant accesses the form to complete it, the form fields triggered by conditional logic will be hidden until their trigger requirement is met.
And vs. Or
When setting up conditional logic where more than one condition or rule must be included or considered, group conditions are used.
There are two types of group conditions:
- And
- Or
Using the And condition tells Next that all of the listed group conditions must be met for the additional form fields to show.
Using the Or condition tells Next that when any of the listed group conditions are met, the additional form fields will show.
Duplicate Fields
Duplicating fields is a basic function of creating forms in Next, and when conditional logic is involved, duplicating fields also copy any configured conditional logic. (Please see the article titled Copy a Form Field for those instructions.)
Duplicating form fields with conditional logic is efficient when creating multiple form fields of the same type using the same conditional logic.
--- REMEMBER ---
When duplicating fields with conditional logic, the form field type is duplicated as well; conditional logic cannot be copied from one form field type to a different form field type.
Examples
The following examples start with the assumption that all form fields have been created and configured for the form, and now, conditional logic needs to be added.
Please note that not all conditional logic configurations are covered in this article as the number of possible conditions is highly variable. Two common examples are shown below to demonstrate the setup.
Example #1: Show Fields Based on a Single Condition
In the following example, a condition is set up to show additional fields if the applicant selects Accounting as their major; these fields will not show if any other major is selected by the applicant.
To reproduce this example:
- Start with an intake form that has the following form fields:
a. A single-select field with a list of majors, including Accounting.
b. A multi-select field with a list of specialties.
c. A long answer text field.
- Select the first field that should be hidden from the applicant until or unless they select Accounting as their major; in this example, the first field to add conditional logic to is a multi-select form field of a list of accounting specialties.
- Select the Add Display Logic icon.
- In the window that appears, the Field dropdown selection defines the trigger condition. In this example, select Select your major, because the result of the applicant’s response will trigger additional fields to show.
--- IMPORTANT ---
The only fields that can define a condition and show up in this dropdown are:
Single-select or multi-select fields appearing before the selected field to which conditional logic is being applied.
- The Condition dropdown lets Next know that the trigger condition is contingent upon the response either being equal or not equal to the Response selection. In this example, select Is, because the rule is based on the applicant selecting Accounting as their major.
- The Response dropdown designates that part of the rule, as related to the previous dropdown selections. In this example, select Accounting.
- Select the Done button to complete the conditional logic configuration for this form field.
- Select the Save button on the form field to save the conditional logic.
- A notation displays at the top of the form field that has conditional logic.
a. The conditional logic can easily be edited by selecting the pencil icon in this banner.
b. The conditional logic can be deleted by selecting the trash can icon in this banner.
- Repeat the above process for the long answer text field with the same Field, Condition, and Response selections. Please note that in this example, the prior question is multi-select, so it appears on the Field dropdown list for the next field being configured.
The above process must be completed for each form field that should appear based on a single condition, which, in this case, is the applicant selecting a specific major.
--- USER TIP ---
List or lay out all form fields before adding them to the form to plan and strategize form field placement when working with conditional logic.
The result of completing this example is an intake form that hides the accounting specialty field and the long answer text box response about an intended career in Accounting until and unless an applicant selects Accounting as their major.
Intake form screenshot before a major is selected:
Intake form screenshot after Accounting is selected as the major:
Example #2 Show Fields Based on Multiple Conditions
If a set of form fields is required for an applicant who has a major in Accounting and also lives in California, but these same form fields are not necessary for other Accounting majors who live outside of California, then the conditional rules for that group would be designated as And.
--- REMEMBER ---
On forms with sections, conditional logic can apply to fields in different sections, as long as the fields for the trigger conditions appear on the form before the field that has conditional logic.
To reproduce this example:
- Start with an intake form that has the following form fields:
a. A single-select field with a list of U.S. states.
b. A single-select field with a list of majors, including Accounting.
c. A multi-select field with a list of specialties.
d. A long answer text field.
- Select the first field that should be hidden from the applicant until or unless they select Accounting as their major; in this example, the first field to add conditional logic to is a multi-select form field of a list of accounting specialties.
- Select the Add Display Logic icon.
- In the window that appears, the Field dropdown selection defines the trigger condition. In this example, select In what U.S. state do you reside?, because it is the first of multiple conditions that need to be met for the additional fields to show.
- The Condition dropdown lets Next know that the trigger condition is contingent upon the response either being equal or not equal to the Response selection. In this example, select Is, because the rule is based on the applicant selecting California as their residential state.
- The Response dropdown designates that part of the rule, as related to the previous dropdown selections. In this example, select California.
- Since this example is based on multiple conditions, select the + icon to add another set of conditions to define.
- In the Field dropdown of the new line, select Select your major.
- In the Condition dropdown, select Is.
- In the Response dropdown, select Accounting.
- The checkboxes next to each conditional line allow the creation of group conditions by letting Next know which lines to include in the group. Since both of the two above conditions need to be met to show the additional form fields, select the checkbox to the left of each of the conditions.
- Select the Create Logical Group button.
- When a logical group is created, the rule of And or Or is applied. In this example, select And since both conditions need to be true for the additional form fields to show.
- Select the Done button to complete the setup of the conditional logic for that form field.
- Select the Save button on the form field to save the conditional logic.
- Repeat the above process for the long answer text field with the same Field, Condition, and Response selections and grouping of conditions.
The above process must be completed for each form field that should appear based on the multiple conditions.
The result of completing this example is an intake form that hides the accounting specialty field and the long answer text box response about an intended career in Accounting until and unless an applicant selects BOTH California as their residential state and Accounting as their major.
Intake form screenshot before California and Accounting are selected:
Intake form screenshot after California is selected, but before a major is selected:
Intake form screenshot after California is selected, and after Accounting is selected as the major:
Please see the article titled Conditional Logic: Additional Functions and the article titled Conditional Logic: Nesting Conditions and Examples for additional information.
Comments
0 comments
Please sign in to leave a comment.