Conditional fields are form fields that only show up for a user when certain criteria are met. This helps to streamline your form and improve your user experience by only showing the fields that are relevant to the submitter. This article will show you how to create conditional form fields.
In this Article
- Conditionals in Forms
- Date-based conditionals
- Field-based conditionals
- Conditional notification emails
Conditionals in Forms
In Forms, you can have conditionals appear based on the date and/or based on the submitter’s response in an earlier field. You can also send emails to admins based on conditional fields. This article explains each of these options.
Date-based conditionals
Date-based conditionals are shown on a form when the submitter is filling it out before, after, or in between certain dates. This can be useful for adding an early-bird discount, for example, or showing an option that is only available for a certain amount of time.
How to add date-based conditionals to a field
- After adding the field, click on the field to open up the options in the right toolbar.
- Expand out the Conditional Rules accordion.
- Toggle on next to Date-Based.
- Choose from the dropdown whether you want the field to be shown before a certain date/time, after a date/time, or in between two dates/times.
- Use the date picker(s) to choose the applicable date and time.
To indicate that it is now conditional, a “Rules” badge will be shown in the top-right corner of the field.
Field-based conditionals
Important Note
In order to use field-based conditionals, you must first save the form with the fields in place. The field you want to make conditional must be underneath the field whose response you want to base it on.
- After you have saved or updated the form, the option for field-based conditionals will appear under the “Conditional Rules” menu in the field settings for most fields.
- Using these settings, you can create one or more rules to show a field only when a submitter has responded to previous questions in a specific way.
- If you use multiple rules, you can even decide whether all of the rules (AND logic) or any of the rules (OR logic) must be followed.
How to create a field-based conditional rule:
- After adding a field, click on the field to open up the options in the right toolbar.
- Expand out the Conditional Rules accordion.
- Begin by toggling the Field-based option.
- Add a rule: Click Add to start creating a rule. Two dropdown fields will appear.
- Select the field: From the first dropdown, select any field that is above the field you are setting the rule for. This can include both text fields and select fields.
- Choose the operator: The second dropdown lets you choose the operator for the rule. The options depend on whether you selected a text field or a select field in the first dropdown.
-
Define the condition for text fields: If you selected a text field, you can base the rule on whether the field:
“contains”, “does not contain”, or “is exactly” the value you enter in the field below. - Define the condition for select fields: If you selected a select field, the options are: “is any”, “is all”, “is not any”, and “is not all.”
- Specify choices for the rule: Specify one or more of the choices given in the designated field to complete the rule. For a Multiple Choice field, to show the conditional field when someone has selected both Choice A and Choice B, choose “is all” and then select those options. To show the field when someone selects either of these choices, select “is any” instead.
Add additional field-based conditional rules
Once you have finished the first rule, you can click on Add again to make a second rule. If you decide to make multiple rules, specify from the dropdown at the top of the conditional section whether the field will be shown if “any” or “all” of the rules are met.
As with date-based conditionals, a Rules badge will be shown in the top-right corner of the field.
Conditional notification emails
Conditional notification emails follow the same rules as date-based and field-based conditional fields; however, instead of showing a field, they send a notification email to a specific person only when the conditions are met.
These notifications are part of the “Send to Admins” notification emails under the Submit button settings. For full details about setting up these notifications, read the Customize Submit options article.
How to add conditional rules to an admin notification:
- Click on the Submit button field.
- Toggle on Send to Admins.
- Click on the star icon next to the user’s email address.
- This will take you to the Conditional Rules settings, where you can add date-based and field-based rules exactly as described above.
If conditional rules have been added to an admin notification, the star icon next to their email address will be pink. Select the star again to edit or remove existing rules.
Comments
Please Sign in to leave a comment if you don't see the comment box below.