For the complete documentation index, see llms.txt. This page is also available as Markdown.

Examples and recipes

Eight complete conditional logic setups you can copy, from a simple reveal to a branching form.

Each example lists the options involved, where to apply the rule, and the exact condition. Replace the labels and values with your own.

Two rules apply to every example: the trigger option must appear above the option the rule is applied to, and a hidden option is not validated.

1. Reveal a gift message when gift wrap is chosen

This is the most common use of conditional logic.

Option
Type
Notes

Gift wrap

Checkbox

One value: Yes, wrap it as a gift, priced

Gift message

Textarea

Max character 200. The rule goes here

Rule on Gift message: Show · All · Gift wrap — contains — Yes, wrap it as a gift

Use contains rather than is equal to, because Checkbox allows multiple selections. If you later add a second value such as Gift bag, an is equal to rule stops matching.

2. Reveal font and position once they have typed an engraving

This detects that the customer wants engraving, without checking what they entered.

Option
Type
Notes

Engraving text

Text

Max character 15, priced

Engraving details

Section

The rule goes here, containing the two options below

Engraving font

Font picker

Five fonts

Engraving position

Radio button

Front, Back

Rule on the Engraving details section: Show · All · Engraving text — number of characters is greater than — 0

One rule on the section controls both options inside it. If you add a third engraving option later, no extra rule is needed.

3. Warn when the engraving is too long to look good

This displays a warning without blocking the purchase.

Option
Type
Notes

Engraving text

Text

Max character 20

Warning

Paragraph

The rule goes here. "Messages over 12 characters are engraved smaller."

Rule on the paragraph: Show · All · Engraving text — number of characters is greater than — 12

Static types support conditional logic so you can display a warning based on the customer's input.

4. Offer a design service to customers who have no artwork

This offers a service when the customer has no file to upload.

Option
Type
Notes

Your artwork

File upload

Not required

Design service

Switch

The rule goes here. Priced, One time charge

Rule on Design service: Show · All · Your artwork — no file

The option is displayed only while no file has been uploaded, and is hidden as soon as the customer attaches one.

5. Ask for placement once they have uploaded a photo

This is the reverse of the previous example.

Option
Type
Notes

Your photo

File upload

Required, image editor on

Photo placement

Image swatch

The rule goes here. Three layout options

Rule on Photo placement: Show · All · Your photo — has file

6. Engraving only on the metal version

This uses a variant condition, which requires the advanced level of conditional logic. See Conditions based on Shopify variants.

Option
Type
Notes

Engraving

Section

The rule goes here

Rule on the section: Show · All · Shopify variant — contains — Silver

Use contains rather than is equal to, so the rule matches both Small / Silver and Large / Silver.

Test this on a real product page. The builder preview cannot evaluate variant conditions.

7. A tiered upsell that reveals its own extras

Each service level displays only the options that belong to it.

Option
Type
Notes

Service level

Radio button

Standard, Plus, Premium, each priced and with its own help text

Premium extras

Section

Rule A, containing the premium-only options

Standard notice

Paragraph

Rule B. "Standard does not include insurance."

Rule A on Premium extras: Show · All · Service level — is equal to — Premium

Rule B on Standard notice: Show · All · Service level — is equal to — Standard

Use is equal to here because the radio button allows only one selection.

8. Reveal a bulk-order note when they order a lot of extras

This reacts to the number of selections rather than to a specific value.

Option
Type
Notes

Add-ons

Checkbox

Eight values, each priced, Max selections 8

Bulk note

Paragraph

The rule goes here. "Orders with more than three extras take an extra 2 days."

Rule on Bulk note: Show · All · Add-ons — number of selections is greater than — 3

Two conditions at once

The examples above use one condition each. The following examples combine two or more.

A gift message only for gift-wrapped express orders

Rule on Gift message: Show · All ·

  • Gift wrap — contains — Yes, wrap it as a gift

  • Delivery — is equal to — Express

A lead-time warning for anything personalized

Rule on the warning paragraph: Show · Any ·

  • Engraving text — number of characters is greater than — 0

  • Your photo — has file

  • Custom color — is enabled

Use Any here, because one personalized element is enough to display the warning.

Patterns to reuse

Pattern
Why it works

A Switch at the top of a form, with a Section below it carrying one rule

The cleanest possible "do you want to personalize this?" flow. Two objects, one rule.

number of characters is greater than 0 as a "did they fill this in" test

Works whatever they typed, and needs no maintenance when your wording changes.

Rules on Paragraph options for contextual warnings

Says the right thing at the right moment, instead of a wall of caveats nobody reads.

One rule on a Section instead of the same rule on six options

Faster to build, and impossible to get half-right.

Two option sets rather than one heavily branched set

When almost everything differs, targeting by product tag is clearer than logic.

Last updated

Was this helpful?