Conditional Logic 101: Show/Hide Form Fields Based on User Answers
Build dynamic forms that adapt to user responses. Reduce clutter, improve completion rates, and collect better data.
What Is Conditional Logic?
Conditional logic lets you show or hide form fields based on how users answer previous questions. Instead of showing every possible field to every user, the form adapts in real-time.
Simple Example
Question: "Do you need a demo?"
- → If YES: Show calendar booking field
- → If NO: Skip to next section
The user only sees fields relevant to their answers. Forms feel shorter, cleaner, and more personalized.
Why Use Conditional Logic?
- Higher completion rates: Users don't abandon long forms because they only see relevant fields
- Better data quality: No more "N/A" or blank fields where questions didn't apply
- Reduced confusion: Users don't waste time reading irrelevant questions
- Personalized experience: Forms feel custom-built for each user
- Professional appearance: Dynamic forms look more sophisticated than static ones
How Conditional Logic Works
You set up rules that control field visibility:
Basic Logic Structure
Trigger Question
The question whose answer determines what happens next
Condition
The rule (equals, contains, greater than, less than, etc.)
Value
The specific answer that triggers the condition
Action
Show or hide specific fields based on the condition
Common Use Cases
Show Additional Fields
Ask: "Are you a new or returning customer?"
→ If New: Show "How did you hear about us?"
→ If Returning: Show "Previous order number"
Skip Irrelevant Sections
Ask: "Do you have employees?"
→ If YES: Show employee count, payroll questions
→ If NO: Skip directly to business info section
Route to Different Workflows
Ask: "Company size?"
→ If 1-10: Show self-service pricing calculator
→ If 11-100: Show mid-market contact form
→ If 100+: Show enterprise sales request
Real-World Examples
Example 1: Event Registration
Question 1: "Will you attend in-person or virtually?"
If In-Person:
- → Show: Meal preference
- → Show: Parking needs
- → Show: T-shirt size
- → Show: Accessibility requirements
If Virtual:
- → Show: Time zone
- → Show: Preferred session format
- → Hide: All in-person logistics fields
Example 2: Customer Support Intake
Question 1: "What type of issue are you experiencing?"
If Technical Issue:
- → Show: Browser type
- → Show: Operating system
- → Show: Error message screenshot upload
If Billing Question:
- → Show: Invoice number
- → Show: Transaction date
- → Show: Billing email
If Feature Request:
- → Show: Feature description
- → Show: Use case explanation
- → Show: Priority level
Example 3: Loan Application
Question 1: "Loan amount requested?"
If Under $50k:
- → Show: Employment verification
- → Show: Income documentation
If Over $50k:
- → Show: All basic fields above
- → Show: Tax return upload (last 2 years)
- → Show: Credit report authorization
- → Show: Collateral information
- → Show: Business plan (if applicable)
Types of Conditions
Available Condition Rules
Equals
Show field if answer exactly matches value (e.g., "Industry equals Healthcare")
Does Not Equal
Show field if answer is anything except specified value
Contains
Show field if answer includes specific text (e.g., email contains "@gmail.com")
Greater Than / Less Than
Show field if numeric answer meets threshold (e.g., "Budget > $100k")
Is Empty / Is Not Empty
Show field based on whether previous field was filled in
Advanced: Multiple Conditions
You can combine multiple conditions with AND/OR logic:
AND Logic: All conditions must be true
Show "Enterprise features" field IF:
- → Company size > 100 employees AND
- → Budget > $50k per year
OR Logic: Any condition can be true
Show "Compliance requirements" field IF:
- → Industry equals Healthcare OR
- → Industry equals Finance OR
- → Industry equals Government
Best Practices
- Start simple: Add conditional logic to one or two key questions first, then expand
- Test thoroughly: Fill out your form multiple times with different answers to verify logic works
- Keep it intuitive: Fields appearing/disappearing should feel natural, not jarring
- Don't overdo it: Too many conditions make forms hard to maintain and debug
- Use clear labels: Make trigger questions obvious so users understand why fields appear
Impact on Form Performance
Before vs After Conditional Logic
38%
Average completion rate for static 20-field form
71%
Average completion rate with conditional logic (users see 8-12 relevant fields)
4m 20s
Average completion time for static form
2m 10s
Average completion time with conditional logic
How Unlayered Makes This Easy
Setting up conditional logic in Unlayered is straightforward:
- Visual rule builder. No coding required
- AI suggests logical rules based on your field types
- Live preview shows exactly how form will behave
- Test mode lets you simulate different answer paths
- Analytics show which paths users take most often
Build Your First Conditional Form
See how conditional logic improves completion rates in minutes
Start Free Trial