Skip to content
Back to the blog
  • conditional questions
  • form design
  • Salesforce forms
  • Form Builder

Conditional Questions in Salesforce Forms: Show Fields Only When They Matter

By TwinStack Team

If a question only applies to some visitors, such as “Which partner referred you?”, it should only appear for them. Everyone else gets a shorter form, and your records stay free of answers nobody meant to give.

Smart Forms & Surveys does this with conditional questions, set up in the Form Builder without code. The follow-up question stays hidden until a visitor gives the answer that makes it relevant.

On the left, the Form Builder rule: show Partner Name when the Lead Source answer is Partner Referral. On the right, the visitor's Website Enquiry form with the Partner Name field showing.
The rule in the Form Builder (left) and the form a visitor sees (right). Product screens are recreations with sample data; no real people or records are shown.

Why show fields only when they matter

Every extra question is one more thing for a visitor to read and fill in, so a shorter form is easier to finish. If a question applies to only some people, ask it only when it applies.

The same rule protects your data. Hidden questions don’t leave stray answers behind, so the records your form creates stay cleaner.

How a conditional question works

A conditional question depends on a controlling question: a picklist or checkbox that is also on the form. You choose which answers make the dependent question appear.

If the visitor picks a different answer, the question stays hidden and its answer is cleared.

Set it up in five steps

  1. Make sure the controlling question, a picklist or a checkbox, is on the form.

  2. In the Form Builder, click the pencil on the question you want to hide.

  3. Turn on Only show this field for certain answers.

  4. Step 1: choose the controlling question. Step 2: tap the answers that should show it.

  5. Check the summary and use Try it to test an answer, then click Save changes and Save & generate form.

On the form canvas, the question is tagged with its rule, for example Shown when Lead Source is Partner Referral, so you can see at a glance which questions are conditional.

Four rules worth setting up

When this answer is chosen Show this question
Lead Source = Partner Referral Partner name
Enquiry type = Support Product or order number
Attending in person = checked Dietary or access needs
Rating = Poor What could we do better?

Tip: combine conditional questions with Make this field required. The follow-up is required only for the people who see it, so you always get the detail you need.

Test it before you share the form

Switch to Visitor view in the Form Builder. Required fields are checked, and dependent questions appear when their controlling answer is chosen, exactly as visitors will see them.

Pick each answer that should reveal a question, then pick one that should not. If the follow-up appears and disappears as expected, the rule is ready to publish.

Good to know

  • The controlling question has to be a picklist or a checkbox, and it has to be on the same form.
  • A hidden question’s answer is cleared, so a visitor who changes their mind doesn’t leave an old answer behind.

Get Smart Forms & Surveys free on AppExchange.

Public web forms that create Salesforce records. Free, 100% native, no code.

Get it free on AppExchange