You are here:
Set Up Dependent Fields on a Form
Use visibility rules to show or hide a field based on the answers a user gives to other fields on a form. With these dependent fields, each field appears when it's relevant to a user.
Before you begin, create a form with at least two fields: one to show or hide, and one that determines when it appears. Give each field a Label and a Unique Name. Make sure you place a determining field before the field it determines, so users answer it first. For example, show a State field only after a user selects a country in a Country field, or reveal a follow-up question only when a user selects a specific option.
- In the Marketing app, click Content, and open your CMS workspace.
- In the Form Builder, open the form.
- Select the field that you want to show or hide. In the field's property panel, open the Rules tab.
- Under Visibility Rules, select New Rule.
-
In the Add visibility rule for window, set Show This
Field When to how you want conditions evaluated.
-
All Conditions Are Met: The field appears only when every condition is true. This is the default.
-
Any Condition Is Met: The field appears when at least one condition is true.
-
The Custom Logic Is Met: The field appears based on an expression that you write, such as 1 AND (2 OR 3), that refers to conditions by number.
-
-
Specify which field or data source drives the visibility rule.
- For Field, select Search Fields, expand Form Fields, and select the field that determines visibility.
- To show or hide a field based on data that you already have about the user, choose a source under Data Graph Fields.
- Choose an Operator:Equal, Not Equal, Contains, Not Contains, Starts With, Is Already Known, or Is Unknown.
- In Value, enter the value the field should match.
- To add another condition, click Add Condition, and repeat. Then click Save.
If you delete a field that determines another field's visibility, the rule no longer works. Update or remove the rule.
The field you selected stays hidden until the user’s entries meet the rule's conditions. On the published form, the field appears when the conditions are met.
