Skip to main content
Forms

Show, hide, or require form fields with Logic

Ask follow-up questions only when they apply. Logic shows, hides, or requires fields based on how someone answers an earlier question.

How Logic works

A Logic rule has two parts:

  • IF โ€“ an answer to a question, such as "Do you own or rent your home?" is "I rent".
  • THEN โ€“ what happens when that answer is given: show fields, hide fields, or make a field required.

Rules react as soon as someone answers, on every page of the form. You can use Logic on the entry form of every promotion type, including surveys and quizzes. It isn't available on winner claim forms.

The examples in this article use a solar lead form that sends homeowners and renters down different paths.

Add a rule

  1. Open the promotion builder and select Form.
  2. Find the question the rule should react to, then select the Add logic icon (the branch symbol) in that question's header. A new rule appears directly under the question, with that question already chosen.
  1. Under IF, choose a Condition, such as is, and then the Answer.
  2. Under THEN, choose an Action: Show fields, Hide fields, or Require field.
  3. Choose the fields the action applies to.

The rule saves automatically as soon as both steps are complete. Until then, it's labeled Unfinished rule and has no effect on the form.

To add more rules for the same question, select + Add another rule under its existing rules.

See your rules at a glance

Each rule sits under the question it checks, summarized in plain words, such as IF answer is I rent, THEN show Would you like to hear about community solar?. Select a rule to open and edit it, or select ร— to delete it.

A field controlled by a rule says so under its title: Shown whenโ€ฆ, Hidden whenโ€ฆ, or Required whenโ€ฆ. When several rules control the same field, the first one is shown with +1 more, and hovering lists them all.

Hover over a rule to outline the fields it controls. Hover over a field's Shown whenโ€ฆ line to outline the rule behind it.

What each action does

  • Show fields โ€“ the fields start hidden and appear only when the rule's answer is given. You can choose up to 20 fields in one rule.
  • Hide fields โ€“ the fields are visible until the rule's answer is given. You can choose up to 20 fields in one rule.
  • Require field โ€“ makes one question required while the rule's answer is given. It only applies while that question is visible.

Show and hide can also apply to headings, paragraphs, dividers, banners, and media. If two rules both show or hide the same field, the rule lower in the form wins.

Send people down different paths

Use New Page to split your form into pages, then put each path's questions on its own page. When every field on a page is hidden, that page is skipped, and the progress dots count only the pages each person will actually see.

In the solar example:

  • A Your home page holds roof questions, shown when the answer is "I own my home".
  • A Renter options page holds community solar questions, shown when the answer is "I rent".

Homeowners never see the renter page and renters never see the homeowner page. Both paths end on the same final page.

A heading, text, or media block also keeps a page on screen. To skip a page that has one, include it in the same Show fields or Hide fields rule as the page's questions.

Which questions can start a rule

The question you add a rule to decides which conditions you can choose.

Question typeConditions
Text Input, Text Area, Website URLis, is not, contains, does not contain, starts with, does not start with, ends with, does not end with, is empty, is not empty
Multiple Choice, Dropdownis, is not, is one of, is none of, is empty, is not empty
Multiselect, Rankingincludes any, includes all, includes none, is empty, is not empty
Star Rating, Opinion Scale, Net Promoter Scoreis, is not, is greater than, is greater than or equal to, is less than, is less than or equal to, is empty, is not empty
Checkboxis checked, is unchecked

Text conditions match exactly, including spaces and capitalization.

Some fields can't be used in Logic, either to start a rule or to be shown, hidden, or required. When you choose fields, these appear greyed out with the reason:

  • contact fields, such as name, email, and phone
  • consent fields, such as Official Rules, Email Consent, SMS Consent, and Age Gate
  • security and payment fields, such as Captcha, Passcodes, and Payment
  • fields with Hidden Field turned on
  • other question types, such as dates, file uploads, signatures, and picture choice

Test your rules

The builder preview follows your rules. Answer the questions in the preview as a visitor would, and check that the right fields and pages appear. Then test each path on the published form before you share it.

What happens to answers

  • Hidden answers are cleared. If someone answers a field and a rule then hides it, that answer is cleared and isn't saved. Showing the field again doesn't bring the old answer back.
  • Participant data shows what each person saw. A question someone never saw shows Not shown. A question they saw but left blank shows Shown, not answered. Exports use the same labels.
  • Integrations only receive answered fields. Map fields that rules control as usual. If a field isn't answered, nothing is sent for it, so it can't overwrite a value already saved in your other tool.

Limits

  • Each rule checks one question. To react to several answers of the same question, use is one of or includes any. To react to different questions, add more rules.
  • Revup stops rules that would depend on each other in a loop. Fields that would create a loop are greyed out with Would make these rules depend on each other in a loop.
  • You can't delete a question, or remove an answer, that a rule uses. Revup lists the rules involved so you can change or remove them first.
  • Logic is shared across all languages of a promotion. Edit it in the main language.
  • Participants can only join a promotion that uses Logic through its form. Participant imports from CSV and the API aren't available for it.
  • A form with Logic can have up to 100 rules and 500 fields.

Troubleshooting

The Add logic icon is missing from a question. The question type can't start a rule, or the field has Hidden Field turned on. The icon also doesn't appear while you're editing a language version of the promotion. Switch to the main language.

A field I show never appears. Open the rule and check that it isn't labeled Unfinished rule, and that the answer it checks is the one you're choosing in the preview.

A page still shows when all its questions are hidden. The page has a heading, text, or media block. Add it to the same rule as the page's questions.