Conditional Logic

Conditional logic allows you to create dynamic forms that adapt based on user input. This guide explains how to set up and use conditional logic in your Formify forms.

What is Conditional Logic?

Conditional logic lets you show or hide form elements based on how users respond to previous questions. This creates a personalized experience for each user, showing only relevant questions and reducing form abandonment.

Benefits of Using Conditional Logic

  • Shorter forms: Users only see questions relevant to them
  • Higher completion rates: Less overwhelmed users are more likely to finish your form
  • Better data quality: Collect more targeted and relevant information
  • Improved user experience: Create a conversational flow that feels more engaging
  • Reduced errors: Prevent contradictory or irrelevant answers

Setting Up Conditional Logic

Basic Concepts

  1. Trigger: The form element that causes a condition to be evaluated
  2. Condition: The rule that determines whether to show or hide elements
  3. Target: The form element(s) affected by the condition

Step-by-Step Guide

  1. Create your form with all necessary elements
  2. Select the element you want to show/hide conditionally
  3. Open the element properties panel
  4. Enable "Conditional Display" toggle
  5. Set up your condition rules:
    • Select the trigger element
    • Choose a comparison operator (equals, not equals, contains, etc.)
    • Enter the value to compare against

Example Scenarios

Example 1: Simple Show/Hide

  • Question: "Do you have any food allergies?"
  • Logic: If user selects "Yes", show a follow-up question asking "Which foods are you allergic to?"

Example 2: Multiple Conditions

  • Question: "Which services are you interested in?"
  • Logic: If user selects "Website Design", show website-related questions
  • Logic: If user selects "Marketing", show marketing-related questions

Example 3: Conditional Form Paths

  • Question: "Are you a new or returning customer?"
  • Logic: If "New", show onboarding questions
  • Logic: If "Returning", show account lookup field

Advanced Conditional Logic

Multiple Conditions (AND/OR Logic)

You can create complex conditions using AND/OR logic:

  • AND logic: All conditions must be true for the target to be displayed
  • OR logic: At least one condition must be true for the target to be displayed

To set up multiple conditions:

  1. Click the "Add Condition" button
  2. Choose AND or OR operator
  3. Set up additional conditions

Nested Conditions

You can create nested conditions for complex form flows:

  1. Set up your first level of conditional logic
  2. For elements that are already conditional, add another layer of conditions
  3. The element will only show if all layers of conditions are satisfied

Conditional Page Branching

For multi-page forms, you can use conditional logic to determine which page appears next:

  1. Go to page settings
  2. Enable "Conditional Next Page"
  3. Set conditions for different page paths

Tips for Effective Conditional Logic

  • Plan your logic flow: Sketch out your form's decision tree before building
  • Test thoroughly: Preview your form and test all possible paths
  • Keep it simple: Overly complex logic can be difficult to maintain
  • Consider mobile users: Ensure conditional elements work well on smaller screens
  • Provide clear instructions: Help users understand how their choices affect the form
  • Use consistent formatting: Keep conditional and non-conditional elements styled similarly

Common Use Cases

Registration Forms

  • Show different fields based on account type (personal vs. business)
  • Collect additional information based on user role or permissions

Event Registration

  • Show specific sessions based on selected ticket type
  • Display accommodation options only for multi-day attendees

Surveys

  • Ask follow-up questions based on satisfaction ratings
  • Branch questions based on demographic information

Order Forms

  • Show product options based on selected product category
  • Display shipping options based on delivery address

Application Forms

  • Show different questions based on application type
  • Request additional documentation based on specific answers

Troubleshooting

Common Issues

  • Circular references: When conditional elements depend on each other
  • Hidden required fields: Required fields that never become visible
  • Performance issues: Too many conditional rules slowing down the form
  • Mobile display problems: Conditional elements not displaying properly on mobile devices

Solutions

  • Simplify your conditional logic where possible
  • Make sure all required fields can become visible in every scenario
  • Test your form thoroughly on different devices
  • Use "Clear" buttons to reset dependent fields when trigger values change

Need Help?

If you need assistance with setting up conditional logic in your forms, please contact our support team for personalized help.