Adding Form Conditions to Selectively Display Fields

  • Updated

Form Conditions change the content shown to your Form's visitors based on the information they provide. Conditions dynamically hide or reveal Form blocks and sections as contacts fill out your Form, improving the user experience by reducing the time and effort needed to complete it.

Example Use Cases

  • Ask specific questions or hide irrelevant questions for contacts with particular characteristics (for example, certain lead contacts)
  • Display a drop-down for State/Territory/Province when contacts select their geographical location
  • Prevent unwanted Form submissions by hiding the submit button (see also: How to Suppress Form Submissions)

Getting Started

You'll find Form conditions settings in the Design tab of the Forms Composer. Before adding any conditions, you should complete your Form's design and make sure all necessary fields are included. To do this:

  1. Add all the fields you'd like to gather contact information with into your Form
  2. Add a Submit button
  3. Save the Form

Need help creating your Form? See our Forms Composer User Guide for additional guidance.

Every Form condition includes a pair of IF and THEN statements that define your Form's behavior. 

Form Condition Statement Description Components  Example
IF

The IF statement defines a contact's response as a triggering action on your Form.

If, State, and Value

Clicking a checkbox next to "Yes, I would like to be contacted by an agent."

THEN

The THEN statement defines the Form's behavior when triggered by the IF statement. 

Do, and Field

Revealing different time slots where the contact can indicate their availability. 

Instructions

Step 1: Add a New Form Condition

  1. Go to Content > Forms
  2. Hover over your Form's name and click Edit to open it in the Forms Composer
  3. In the Forms Composer, go to the Design tab
  4. In the right-hand Settings panel, click Form Conditions 
  5. Click Add Rule to create a new rule for your Form
  6. Enter a Rule Name – if your Form has multiple rules, use names to remember the purpose of each 

Optional: Check the Case Sensitive box if you'd like your condition's values to be case-sensitive

Step 2: Set an IF Statement

The IF statement defines the behavior or response by Form visitors that will activate your Form's condition. When a Form visitor meets this condition, it will trigger your Form to hide or show the field selected in Step 3. You'll need to fill in the following fields to create your IF statement: If, State, and Value

Components Input How it works

If

Select one of your Form fields from the drop-down menu

Select the Form field that will activate your Form condition.

You can apply multiple IF statements by using AND and/or OR to create more complex conditions for your Form.

State

Select a qualifier from the drop-down menu

(Is Equal To, Contains, Starts With, etc.)

Set the logic for how values entered in the above field will meet your Form condition. 

Value

Free text entry

Enter the value that Form visitors must enter to trigger the condition.

If you've selected "Is Empty" or "Is Filled" for State, you do not need a Value.

For a multiple-choice field (picklist, combo box, etc.), the value must match exactly or the Form condition may not function as expected.

Heads up! Your Form condition will stop working if you delete the Form field used to create the above IF statement. Be sure to test your condition after editing or deleting any Form fields.

Step 3: Set a THEN Statement

Your THEN statement defines how your Form dynamically changes when the above IF condition is activated. If your contact's behavior or Form response triggers the condition set by your IF statement, the THEN statement tells your Form to hide or show another field.

You'll need to set the following components for each THEN statement: Do and Field

Components Input How it works

Do

Select Hide or Show from the drop-down menu

Select whether to hide or show the below field when your contact meets the conditions set by your IF statement.

Hide:

  • The below field will show when the Form first loads
  • The below field will disappear when your contact enters a response that triggers the condition set by your IF statement field
  • This prevents your contact from submitting irrelevant data

Show:

  • The below field will be hidden by default when the Form first loads
  • Your contact will only see the below field appear when they meet the IF condition
  • This allows you to ask increasingly relevant questions based on the data you’ve collected in existing fields

Field

Select one of your Form fields from the drop-down menu

You cannot select the same field used in your IF statement

Select which Form field will dynamically appear or be hidden when your contact's behavior activates the IF condition.

Once you have set both IF and THEN statements, click OK to save your new Form rule. Click Close to exit the Form Conditions panel.

Special features & options for THEN statements

Dynamic Submit Button

Hide or show the Form's submit button to suppress Form submissions. For more information on how or why to use this feature, see How to Suppress Form Submissions.

Dynamic Form Sections

Set your condition's logic to hide or show entire Form sections. This makes the conditional logic simpler and easier to manage when you have multiple fields to hide or show. Each Form section is assigned a number and will appear as Section [no.] in your THEN statement's Field drop-down menu.

Dynamic Content Blocks, Images, and Text

Show specific content blocks, such as Rich Text or Images. This allows for custom messages or images to show on your Form based on how your Form visitors complete your conditional fields.

Multiple THEN Statements (Advanced)

Use multiple THEN statements to have multiple results occur based on actions defined by your IF statement. Create additional THEN statements for your Form condition by clicking AND.

Step 4: Test Your Form Condition

Save your Form before testing. You won't be able to test Form conditions without saving first.

Test in the Forms Composer (recommended)

  • Go to the Review tab in the Forms Composer to preview your Form
  • Fill out your Form fields to see whether it hides or shows conditional fields as expected

Test your live Form

  • Visit the Form where it's been embedded (for example, a landing page accessed via a public URL).
  • Fill out your Form fields to see whether your Form dynamically hides or shows fields as defined by your condition rules.

Pay attention to the following when creating and testing your Form conditions:

  • It is always the best practice to test your Form before launch. To ensure the logic is functioning as expected, run tests for all conditions and response combinations.
  • Multiple Form conditions may cancel each other out or cause usability errors if set up incorrectly. If you see these errors during testing, check each condition's logic and field selections to make sure they won't cancel out settings for another condition.
  • Form conditions are not the same as progressive profiling sections and will produce different results when visitors fill out your Form. See the below FAQs section to help you decide which Form feature will best meet your goals.

Example Use Case

Create a Single Contact Form for Leads & Customers

This example demonstrates how to use Form conditions to create a single dynamic Form for both leads and existing customers. This Form will hide or show additional fields and questions depending on whether the Form visitor is an incoming lead or a current customer.

  IF... THEN... Example

Customer

If the contact responds "Yes" to the below field:

If = "Are you a current  customer?"

State = Is Equal To

Value = "Yes"

Then the Form responds by asking the customer for their account number.

Do = Show

Field = "Account Number"

Form_Conditions_1.png

Lead

If the contact responds "No" to the below field:

If = "Are you a current customer?"

State = Is Equal To

Value = "No"

Then the Form responds by asking for their lead source.

Do = Show

Field = "How did you hear about us?"

Form_Conditions_2.png

Lead Source = Friend

If the contact answers "Friend" to Lead Source field:

If = "How did you hear about us?"

State = Is Equal To

Value = "Friend"

Then the Form responds by asking for the Friend's contact name.

Do = Show

Field = "Who can we thank"

Form_Conditions_3.png

FAQs

How are Form Conditions different from Progressive Profiling?

Form Conditions:

  • Set rules to hide and show Form fields or Form sections based on a contact's responses at the moment they're completing your Form.
  • This is useful for collecting only relevant information, hiding fields that do not apply to a particular contact, or asking certain contacts additional questions.

Progressive Profiling:

  • Used for leads and contacts who will be completing a single Form multiple times (e.g., for gated content)
  • Set rules to limit the number of fields that show each time the contact completes the same Form.
  • Slowly gather more profile information each time an engaged lead fills out the same Form.
  • See our user guide on Progressive Profiling for more information.

How do I save a set of Form Conditions to use in future Forms?

You can save a set of Form conditions by creating a Form Template. Use this template as a starting point for each new Form where you'd like to apply the same conditional logic.

How can I hide my Form fields when the page loads and show them later?

Do this by creating a condition with a THEN statement set to Show. Your Form will automatically hide any field set to Show via a Form condition and will reveal the field only when your THEN statement's rule is met.

Was this article helpful?

Have more questions? Submit a request