Conditional Logic
Learn how widgets use conditional logic to show or hide fields based on people's answers.
Widget use conditional logic to hide or display 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.
Fields
You must configure conditional logic on a field-by-field basis. There is no limit to the number of dependencies that you can configure. Currently, Radio Button Horizontal and Radio Button Vertical are the only supported field types that a form field can depend on.
You must configure two fields on a form field record to enable conditional logic:
- Depends On
- Enter the form field that the current form field depends on. The current form field will display or hide based on a respondent's answer to the form field selected here.
- Depends On Value
- The exact field value from the selected form field that the respondent must choose 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 ExperienceKeep in mind that each new line in the field values section represents a new radio button in the form: 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.
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.
Walkthrough
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:
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:
Research and development is an advanced position, so respondents who select "R&D" will be asked about their other experience:
Those without Scoop Shop experience will be encouraged to start in another position before applying to "R&D":
Those with Scoop Shop experience are then questioned about their culinary experience:
On the other hand, those are answered "No" to the original question are presented with an entirely different set of form fields: