Skip to main content

Conditional logic examples

What it does​

Four rules that make a return form ask only what each customer needs to answer. The examples build one form, Return or Exchange, in order: each adds a few fields and one rule, and the third reuses the Reason field of the first. To use one in your own form, add the fields it names, then the rule, and change the names to yours.

In the finished form, the customer chooses a refund or an exchange and gives a reason, and your team learns when to collect a damaged item.

Uses: Show or hide fields and sections and Adding fields and sections.

Before you start​

Steps​

Ask for details only when they apply​

The customer describes the damage only if the item arrived damaged.

  1. Add a section and give it the Section Title Your return.

  2. In it, add a Select field with the label Reason.

  3. Give Reason the options Changed my mind, Arrived damaged, Wrong item and Other.

  4. Below Reason, add a Textarea field with the label Describe the damage.

  5. Select Required for Describe the damage.

  6. On the Logic board, click New rule and fill it in:

    Setting Value
    Trigger field Reason
    Condition is
    Values Arrived damaged
    Action Show
    Fields & sections Describe the damage, under Your return
  7. Click Save rule.

Describe the damage stays hidden until the customer selects Arrived damaged. It's required only while it's visible.

Show a whole section for one answer​

Only customers who want an exchange see the questions about the new item.

  1. In Your return, above Reason, add a Radio field with the label What would you like?.

  2. Give it the options A refund and An exchange.

  3. Below Your return, add a section with the Section Title Exchange details.

  4. In it, add a Text field with the label Item you want instead.

  5. Add a rule:

    Setting Value
    Trigger field What would you like?
    Condition is
    Values An exchange
    Action Show
    Fields & sections the section Exchange details
  6. Click Save rule.

The trigger field sits in Your return, not in the section it shows. The panel doesn't let a rule control the section that holds its own trigger field.

Show a section for any of several answers​

Your team collects the item when it arrived damaged or was the wrong one. This example reuses Reason from the first one.

  1. Below Exchange details, add a section with the Section Title Collection.

  2. In it, add a Select field with the label Best day for collection.

  3. Below it, add a Textarea field with the label Access notes.

  4. Add a rule:

    Setting Value
    Trigger field Reason
    Condition is
    Values Arrived damaged and Wrong item
    Action Show
    Fields & sections the section Collection
  5. Click Save rule. The board shows the rule as ANY OF Arrived damaged, Wrong item.

Reason now starts two rules. Each rule works on its own: Arrived damaged shows both Describe the damage and Collection, Wrong item shows only Collection.

Hide a required field that doesn't apply​

Order number is required, but some customers can't find it. A tick lets them skip it.

  1. Above Your return, add a section with the Section Title Your order.

  2. In it, add a Text field with the label Order number.

  3. Select Required for Order number.

  4. Below it, add a Checkbox field with the label No order number?.

  5. Give it one option, I can't find my order number.

  6. Add a rule:

    Setting Value
    Trigger field No order number?
    Condition is
    Values I can't find my order number
    Action Hide
    Fields & sections Order number, under Your order
  7. Click Save rule.

Order number is visible at first. When the customer ticks the box, it disappears, and they can send the form without it.

What you should see​

Open the form on your store and try each answer.

Return or Exchange form with Reason set to Arrived damaged: Describe the damage and the Collection section are now shown
  • Reason set to Arrived damaged shows Describe the damage and the Collection section.
  • Wrong item shows only Collection. Changed my mind or Other shows neither.
  • An exchange shows Exchange details. A refund hides it again.
  • Ticking I can't find my order number hides Order number, and the customer can send the form without it.

In Content → WebForms → Inbox, the page of each submission shows only the answers the customer could see.

Limits​

  • A rule starts only from a field with options. Conditions on emails and confirmations can test a typed answer, but they run after the form is sent and don't show or hide anything. See Condition operators.
  • A rule can't show or hide the section that holds its own trigger field.
  • If the customer types into a field and then changes the answer that hides it, the text isn't saved.

Troubleshooting​

  • The field shows from the start. The rule's Action is Hide, or the rule is switched off. For a follow-up question, use Show.
  • Nothing changes on the store. Check that you published the form after saving the rules, that each rule's Enabled switch is on, and that its Values are the options you're choosing on the store.
  • The section is greyed out in the panel. It holds the trigger field. Move the trigger field to another section, or control the fields one by one.

What's next​

Applies to WebForms 4Last reviewed October 14, 2026