> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help-option.ymqapp.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Conditional Logic Function

1. [Option](/ymq-options-v2/option)

# Conditional Logic Function

📌 This feature lets you show or hide option values depending on the choices made in other options or specific Shopify variants.

---

**🔧 Settings**

1

**From Option set, select the option you want to apply conditional logic**

![](https://storage.crisp.chat/users/helpdesk/website/-/8/9/e/a/89eafe1d67c82800/0306094a-1b99-45c8-85a9-a7e568_bd3t1a.jpg)

2

**Add Conditional Logic**

In the **Option Configuration panel** on the left, click **"Add condition"** at the bottom.

![](https://storage.crisp.chat/users/helpdesk/website/-/a/0/7/7/a077bb9ae32a1800/992fcbed-97ed-4414-bcd5-bd6678_1pbeyk8.jpg)

3

**Choose What to Match**

Select whether you want to base your conditions on the **previous option**, **Shopify variants**, or even options from **other option sets**.

* **Shopify options** — Variant options created in Shopify. ⭐ _Note: The condition value will match if it matches_ _**any**_ _option value of the variant. For example, for a variant like_ _**XS / Red / Men**__, matching_ _**any one**_ _of these values (XS, Red, or Men) counts as a match._
* **App options** — Options created within this option set.
* **Product** — Basic product information.

* Product title
* Product tag
* Product price
* Product type
* Product vendor
* **Manual** — Manually entered values, typically used to reference options from **another option set.**

![](https://storage.crisp.chat/users/helpdesk/website/-/7/c/e/e/7cee24e6422eec00/8866421e-666e-4a94-9b03-7d89ee_1loyuh4.jpg)

4

**Set Your Display Rules**

Decide when the field should appear or disappear based on the conditions you create:

* **Show:** The field will only show up if _all_ conditions are true. If not, it will stay hidden.
* **Hide:** The field will hide if _all_ conditions are true. Otherwise, it will show.

![](https://storage.crisp.chat/users/helpdesk/website/-/c/5/7/2/c5726a220d17e000/fdc4137c-448a-4685-baa0-e5a3c5_1rcdahz.png)

5

**Decide How Conditions Work Together**

* **All Conditions (AND):** The field reacts only if _every_ condition is true.
* **Any Condition (OR):** The field reacts if _at least one_ condition is true.

💡 **Important:** Our condition system is one of the **most flexible** available. You can use **only AND**, **only OR**, or even **combine AND and OR together** within the same rule — a capability that **no other app currently offers**.

![](https://storage.crisp.chat/users/helpdesk/website/-/5/6/2/7/56274421c9630800/baa72c3e-b76e-4978-9e46-fda983_mxflpl.png)

6

**Set Conditions Between Options**

Here are the condition types you can use to link options:

* **is equal to** — Show the field when the previous option exactly matches your selected value.
* **is not equal to** — Show the field when the previous option does _not_ match your selected value.
* **has no value (is empty)**
* **has value (is not empty)**
* **contains text**

* 💡 If an option is a **text field**, you can check whether the customer’s input **contains a specific substring**.
* 🔹 **For example:** if the condition is "**contains** _**abc**_**"**, the input must include _**abc**_ anywhere in the text.

* ✅ **Matches:** abc, 123abc, abc123, 1abc2, xyzabcxyz
* ❌ **Not matches:** ab, ac, a b c, 123, xyz
* **does not contain text** — Opposite of **contains text**
* **starts with**

* 💡 For **text fields**, this condition checks whether the customer’s input **begins with a specific substring**.
* 🔹 **For example:** if the condition is "**starts with** _**abc**_", the input must start exactly with _**abc**_.

* ✅ **Matches:** abc, abcdef, abc123
* ❌ **Not matches:** ab, 1abc, xabc, 123abc
* **ends with** — Opposite of **starts with**
* **is one of**

* 🔹 **For example:** Option A is a **single-select field** with values: **A1, A2, A3, A4**. If you set the condition "**Option A is one of A1, A2**", it means: The customer must select either A1 or A2.

* ✅ **Matches**: A1 , A2
* ❌ **Not matches**: A3, A4
* **is not one of** — Opposite of **is one of**
* **≥**
* **≤**
* **>**
* **<**
* **contains any of**

* **For example:** Option A is a **multi-select field** with values: **A1, A2, A3, A4**. If you set the condition "**Option A contains any of A1, A2"**, it means: The customer needs to select at least one of A1 or A2.

* ✅ **Matches**: [A1], [A2], [A1, A2], [A1, A3], [A1, A4], [A2, A3], [A2, A4], [A1, A2, A3, A4]
* ❌ **Not matches**: [A3], [A4], [A3, A4]
* **does not contain any of** — Opposite of **contains any of**
* **only contains**

* 🔹 **For example:** Option A is a **multi-select field** with values: **A1, A2, A3, A4**.

If you set the condition "**Option A only contains A1, A2**", it means: The customer can select any combination of A1 and A2, but must not select any other values.

* ✅ **Matches**: [A1], [A2], [A1, A2]
* ❌ **Not matches**: [A3], [A4], [A3, A4], [A1, A3], [A1, A2, A3], [A1, A2, A3, A4]
* **does not only contain** — Opposite of **only contains**
* **contains all of**

* 🔹 **For example:** Option A is a **multi-select field** with values: **A1, A2, A3, A4**.

If you set the condition "**Option A contains all of A1, A2**", it means: The customer must select both **A1 and A2**.

* ✅ **Matches**: [A1, A2], [A1, A2, A3], [A1, A2, A4], [A1, A2, A3, A4]
* ❌ **Not matches**: [A1], [A2], [A1, A3], [A1, A4], [A2,A3, A4]
* **does not contain all of** — Opposite of **contains all of**
* **is on** — For a **switch field**, the condition "**is on**" means: The switch **must be toggled on** by the customer.
* **is off** — Opposite of **is on**

---

${frame}[](https://iframely.net/dEvZvqj2)