What would you like to know more about?

Conditional Logic

Learn how the widget uses conditional logic to show or hide fields based on people's answers.

The widget can use conditional logic to show or hide fields depending on answers to earlier questions. This way, only relevant fields display as respondents work through a form.

For example, let's say you're gathering menu information for a new member luncheon, so you have your new members complete a form. On this form, one question asks "Do you have any food allergies?", and they can select either yes or no. If the respondent selects yes, a follow-up question displays to ask "What are your food allergies?" with an option for the respondent to answer. If the respondent selects no, the follow-up question does not display because that question is irrelevant since they already answered that they do not have any food allergies. This helps you gather the information you need without bombarding respondents with a million potentially irrelevant questions.

For a more in-depth understanding, check out the full example. Or, to learn how to add conditional logic, jump to the next section.

Example of Conditional Logic

In this example, you're recruiting volunteers for Dream Team, a community outreach initiative that delivers ice cream and runs a local shop. When people open the form, only one question displays:

Image showing an example question of "Are you a current volunteer?" with answer options "Yes" and "No"

Those who answer "Yes" are asked to share about where they currently serve and pick their preferred Dream Team position. This represents two form fields, both dependent on the same original form field:

Image showing two questions that display after selecting "Yes" to "Are you a current volunteer?", including an open text field for "In which area do you currently serve?" and a multiple choice question for "Select a Dream Team Position"

Research and development is an advanced position, so respondents who select "R&D" will be asked about their Scoop Shop experience:

Image showing an example of the multiple choice question "Select a Dream Team Position" with the answer "R&D" selected, and another question after that of "Do you have scoop shop experience?"

Those without Scoop Shop experience are encouraged to start in another position before applying to "R&D":

Image showing the question "Do you have scoop shop experience?" with the answer "No", and a message after that saying "We invite you to work in our Scoop Shop before applying to R&D. Thank you!"

Those with Scoop Shop experience are then questioned about their culinary experience:

Image showing the question "Do you have scoop shop experience?" with the answer "Yes", and a question after that asking "Do you have any culinary experience" with the answers "Yes, currently", "Yes, previously", and "None"

On the other hand, those who answered "No" to the very first question are presented with an entirely different set of form fields:

Image showing the original question "Are you a current volunteer?" with the answer "No" selected, and a message after that of "Let's get to know you!" with additional questions like "Date of Birth", "Have you joined a Connect Group?", "Have you completed Growth Classes?", and "Preferred Contact Method"

Add Conditional Logic

There are two ways to add conditional logic to your custom form: through the Form Editor tool or by updating the Form Field records after you create the form. Choose the method you feel most comfortable with.

Note:
  • There is no limit to the number of dependencies that you can configure.
  • Currently, you can only add conditional logic to the Radio Button Horizontal and Radio Button Vertical field types.
  • If a required field is not shown based on conditional logic, it will not be required for that user.

Using the Tool

If you're creating a new form or updating an existing form to include conditional logic, you can use the Form Editor tool. Once you add a question and its options, click the blue interlocking chains with a + sign button beside the relevant option. For example, if you want to show a question based on someone answering "Yes" to this question, click the button beside the Yes option.

Example of the Form Editor tool showing the options "Yes" and "No" with the mouse over the link chain button beside "Yes"

Then, click the question that should depend on the selected value, and click Save. The tool does not show this change, but the Form Field record is immediately updated in the background. You can repeat this for each question that depends on the value, and each one will be saved. (So, if you want multiple questions to only show when an answer is selected, make sure to click the link chain button and complete the steps for each question.)

Example of the Form Editor tool showing where to select the question that depends on the selected value

Using Form Field Records

If you've already created your form, you can update the associated Form Field records. There are two fields on the record that enable conditional logic:

Depends On
Select the form field that the current form field should depend on. The current form field will show or hide based on a respondent's answer to the form field you select here.
Depends On Value
Enter the exact field value that the respondent must choose for the "Depends On" form field in order for the current form field to display. Avoid extra spaces before or after this value to ensure proper display in the widget.
Note: Fields you select for a Depends On Value must be part of the same form. If the Depends On Values are not part of the same form, your custom form will not work. Consider adding a sub-page view with the following view clause to help find Depends On Value discrepancies.
Form_Fields.Form_ID <> ISNULL(Depends_On_Table_Form_ID_Table.Form_ID, Form_Fields.Form_ID)
For example, if Depends On is set to the form field "How much volunteer experience do you have?", you can configure the following options in field values:
No Experience
Some Experience
Extensive Experience
Keep in mind that each new line in the field values section represents a new radio button in the form:
Image showing an example question "How much volunteer experience do you have?" with answer options of "No Experience", "Some Experience", and "Extensive Experience"
You must set the Depends On Value to only one field value for the current form field to display. For example, "No Experience." The current form field will collect additional information about potential volunteers with no experience.
Image showing an example of the Depends On Value on the Form Field record with the text "No Experience"

Multiple form fields can share the same values for the Depends On and Depends On Value fields. For example, if a volunteer indicates no experience, you can ask additional questions relevant to them. Each form field must be individually configured, even if they depend on the same initial question.