> For the complete documentation index, see [llms.txt](https://minimateapps.gitbook.io/customfield/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://minimateapps.gitbook.io/customfield/how-to.../how-to-set-a-conditional-logic.md).

# How to set a conditional logic?

Conditional logic allows you to show or hide a field based on a customer’s selection.

#### **Example use case**

You want to ask customers whether their purchase is a gift. If the answer is **Yes**, you want to display an additional field for a gift note.

#### Step-by-step setup

1. First, create a **Checkbox** field with the label **“Is this a gift?”** and apply it to the relevant products.
2. Second, create another field (for example, a **Text Box**) for the gift note.
3. In the **Visibility** section of the second field, enable **Conditional Display**.
4. Set the condition:
   * **IF** the checkbox option equals **“Yes”**
   * **THEN** display this field.

{% hint style="warning" %}
Be sure to select the relevant product for the condition in the **Visibility** section to ensure the logic works correctly.
{% endhint %}

Once saved, the gift note field will only appear when the customer selects the **“Yes”** option for the **“Is this a gift?”** checkbox field.

{% hint style="info" %}
Conditional display is only available for dropdown, checkbox, radio button and image swatch fields.
{% endhint %}

<figure><img src="/files/vyBmeV46O2sic5fSm3jV" alt=""><figcaption><p>Please click "Create this condition" button</p></figcaption></figure>

<figure><img src="/files/NotxzvLCuz0g4hL9qRtb" alt="Condition Added "><figcaption></figcaption></figure>

{% hint style="warning" %}
If you do not click "Create this condition" button, the selected criteria is not saved.
{% endhint %}

Once everything is set, this is how it will appear on your product page. When “Yes” is selected, the text box is displayed. If “No” is selected, the text box remains hidden.

<div><figure><img src="/files/4APyCryhtGqYe6UdsSi4" alt="Is this is a gift? -Yes "><figcaption></figcaption></figure> <figure><img src="/files/IzTGa5QXltdTvRkX3BRc" alt="Is this is a gift? -No "><figcaption></figcaption></figure></div>

Watch the detailed video to learn how to apply conditional logic.

{% embed url="<https://youtu.be/FMuMv7BpwNc>" %}
