# Conditional Logic - Option B is shown/ hidden according to the value of option A

**Scenario:** Only if customers choose to add a card, the option for a message on the card will show. You can check out our [Demo product](https://avisplus-demo.myshopify.com/products/conditional-logic-1) to see how it works 😊

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

{% hint style="info" %}
You can use this example of Conditional Logic to set up an extra charge for the option type that does not support Add charge option such as Text, Large Text, Number, Datetime, Color Picker, and File Upload
{% endhint %}

Here is the step-by-step instruction on how to set up the Conditional logic.

**Step 1.** To begin, you need to create your primary option (Option A). In this case, we created a radio button option asking if the customer would like to add a card.

![](/files/dSNgMKOr1AUS2n1RIkmv)

**Step 2.** Then, create the second option as a text option (Option B) so customers can fill in their message.

![](/files/B8hwJGcW8CGjMzw8nxee)

**Step 3.** Click on **Show Advanced Options** under the second option (Option B).&#x20;

![](/files/IpemO9TEZquAOl4vrGcy)

Then, click on the **Create new conditional rule** then choose the correct **Label on Cart** and make sure that it contains your affirmative value above. Pick the **Label on Cart** of the option that you would like your second option (Option B) to depend on.

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

**Step 4.** Hit **Save** in the bottom right corner of the popup and **Save changes** on the top right corner of the **Option Set** tab and you're all done 🤗


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://options-docs.avisplus.io/app-features/conditional-logic-option-b-shows-if-option-a-is-selected.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
