> For the complete documentation index, see [llms.txt](https://docs.globo.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.globo.io/options/conditional-logic-function.md).

# Conditional Logic Function

**For the detailed setup, you can refer to the instruction video here:** [**How to Show or Hide Options using Conditional Logic in Shopify with Globo Product Options**](https://youtu.be/JuUOy6sdNY8?si=mlW03k5RzAWLQN7l)

## Steps to manage:

{% stepper %}
{% step %}
**From Option set, select the option you want to apply conditional logic**&#x20;

<figure><img src="/files/zF59lRig4uEBBjYcxtau" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Turn On Conditional Logic**\
On the left side, in the **Option Configuration** panel, find and check the box called **"Conditional Logic Options."**

<figure><img src="/files/OO8brbb2jKYJnLdXqjOY" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Choose What to Match**

Select whether you want to base your conditions on the **previous option** or **Shopify variants.**

<figure><img src="/files/PDrrTwpLaOsu16sa0fJN" alt=""><figcaption></figcaption></figure>

**For Shopify variants, it is a must to write down exactly the Variant name on products** <br>

<figure><img src="/files/viGuLea6RSBPPu8vZH44" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**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.

  <figure><img src="/files/yWwvwHteQak0ZiNW03GQ" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}
**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.

<figure><img src="/files/Ps8WniSCNeL9GKFQere2" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Set Conditions Between Elements**

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

* **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.
* **Is greater than:** (For number fields) Show the field when the previous option is greater than a certain number you set.
* **Is less than:** (For number fields) Show the field when the previous option is less than a certain number you set.
* **Starts with:** Show the field when the previous option starts with the value you specify.
* **Ends with:** Show the field when the previous option ends with the value you specify.
* **Contains:** Show the field when the previous option contains the value you specify.
* **Does not contain:** Show the field when the previous option *does not* contain the value you specify.

<figure><img src="/files/kXXJembcer2hDrVuYhG4" alt=""><figcaption></figcaption></figure>

* **For Text option type (Text/Textarea)**, it allows set up the condition of characters number: To show an element if the text field is filled out the the number of characters you set up:&#x20;

<figure><img src="/files/fsXRMmsVKVF5DM4kH7NI" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/TCAlo29DFTTb4NxzDS10" alt=""><figcaption></figcaption></figure>

* **For** **Selection option type** **(Dropdown/Checkbox/Button/Swatch),** it allows set up the condition of selection number. To show an element if the previous option is selected with the number you set up

<figure><img src="/files/IsEmGB8p7YWm5UaU0zU6" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/CNCx9ClRJRbOM8G1QAC4" alt=""><figcaption></figcaption></figure>

* **For Upload file element,** it allows set up to show an element depending on the number of file you set:&#x20;

<figure><img src="/files/ONwm4KyoFCAopPxVI8FS" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

📧 **Need Help?**\
If you run into any issues while setting up your option set, feel free to reach out to us at **Chat** or email [**contact@globo.io**](mailto:contact@globo.io)**.**

We’re always here and happy to help — with sincerity and care!
