How to Add Conditional Logic to Shopify Forms (2026)

Last updated
Expert reviewed
5 min read
Jacques Blom
Jacques Blom
CTO at Fudge.

Key takeaways

  • Conditional logic shows or hides form fields based on a user’s previous answer.
  • Shopify’s native contact form has no conditional logic — you need a form app or custom code.
  • Typeform, Hulk Form Builder, and Jotform all support conditional logic out of the box.
  • Custom JavaScript with show/hide logic is the native option for stores that want full design control.

Conditional logic makes forms smarter. Instead of showing every field to every visitor, you show only the fields relevant to their situation. A B2B inquiry shows company size and industry fields. A B2C customer sees different fields entirely. The form adapts to them.

The result: shorter apparent form length, better data quality, and higher completion rates.

What is conditional logic in a form?

Conditional logic means: “Show field B only if the user answered X to field A.”

A practical example for a Shopify store:

Without conditional logic, you’d need to show all fields to everyone and mark most as optional — a messier experience.


Option 1 — Typeform (best UX for conditional logic)

Typeform has one of the cleanest implementations of conditional logic. Each question can branch based on previous answers, creating a fully personalized form flow.

How to set it up:

  1. In your Typeform form editor, add your branching question (e.g., a Multiple Choice field)
  2. Go to Logic → add a Logic Jump
  3. Set the condition: “If answer is ‘Business’, go to Business Name question. If answer is ‘Personal’, go to Message question.”

Typeform handles the UX automatically — it shows only the relevant questions in sequence.


Option 2 — Hulk Form Builder (Shopify app)

Hulk Form Builder’s conditional logic works with standard Shopify page forms.

Setup:

  1. Install Hulk Form Builder from the App Store
  2. Create your form, add all fields
  3. Select a field → find the “Conditional logic” section
  4. Set rules: “Show this field when [field name] equals [value]”

For a Business vs. Personal example: create the “Customer type” dropdown first, then add conditional rules to Business-specific fields.


Option 3 — Jotform

Jotform has robust conditional logic, including:

Setup: In Jotform’s form builder, select any field → Settings → Conditions → Add a new condition.

Embed the resulting form on your Shopify page via iframe.


Option 4 — Custom JavaScript (no app dependency)

For stores that want full design control and no third-party app overhead, conditional logic can be implemented with straightforward JavaScript.

Example setup:

HTML structure:

<select id="customer-type" name="properties[Customer Type]">
  <option value="">Select...</option>
  <option value="business">Business</option>
  <option value="personal">Personal</option>
</select>

<div id="business-fields" style="display: none;">
  <input type="text" name="properties[Company Name]" placeholder="Company name" />
  <input type="text" name="properties[Industry]" placeholder="Industry" />
</div>

JavaScript:

document.getElementById('customer-type').addEventListener('change', function() {
  var businessFields = document.getElementById('business-fields');
  if (this.value === 'business') {
    businessFields.style.display = 'block';
  } else {
    businessFields.style.display = 'none';
  }
});

This is clean, fast, and has zero external dependencies. The tradeoff: you write and maintain the code, and it needs to be added to your theme’s section or snippet files.

Describe this to Fudge instead: “Build a contact form with conditional logic — if the customer selects ‘Business’, show fields for Company Name and Industry. If they select ‘Personal’, hide those fields.”

Build a conditional logic form by describing it to Fudge.
Try Fudge for Free

Common use cases for conditional logic in Shopify

B2B vs B2C inquiry forms. Show company information fields only for business customers.

Product-specific inquiry routing. “Which product category does your question relate to?” → each answer routes to different follow-up fields and sends the submission to a different department email.

Wholesale application forms. “What is your business type?” (retail, online, wholesale) → show relevant fields for each.

Returns and support requests. “Select your issue type” (damaged item, wrong item, not delivered, other) → each issue type reveals different follow-up fields.

Event or service booking. “Select service type” → show different scheduling and detail fields for each service.


Testing conditional logic

After setting up conditional logic, test every path through the form:

  1. Select each option in your branching question
  2. Verify the correct fields show/hide
  3. Submit the form via each path
  4. Confirm the submission contains the correct data
  5. Test on mobile — conditional logic animations sometimes behave differently on touch devices

For JavaScript implementations, also test with JavaScript disabled to ensure the form degrades gracefully (ideally shows all fields rather than showing nothing).

Jacques's signature
Build smart Shopify forms with conditional logic by describing them.

You might also be interested in

How to Create Multi-Step Forms in Shopify (2026)
Add multi-step forms to Shopify — Shopify's native forms are single-step only. Use Typeform, JotForm, a Shopify form app, or build a native
How to Capture UTM Values in Shopify Forms (2026)
Capture UTM parameters in Shopify contact forms using JavaScript — read UTM values from the URL, store in hidden form fields, and submit with the
How to Add a File Upload Field in Shopify (2026)
Add file upload to Shopify forms — using line item properties for product customization, form apps for contact forms, or custom implementations for