# Switch

Let’s understand how we can use Switch Card in Gallabox with the help of an example use case: **Product Inquiry Chat-bot**.&#x20;

The chat-bot's goal is to assist customers in finding the right products based on their preferences.&#x20;

The conversation begins with the chat-bot greeting the user and asking for their product preferences. The chat-bot prompts the user with a question like "*What type of product are you looking for?*"

We want to evaluate the product type and determine the appropriate action after capturing the user’s response. In the next series of steps (including screenshots) we will guide you on how to do this.&#x20;

1. **Switch Type:**&#x20;

Enter the Switch type as either “**Find Best match**” or “**Equals**” depending on the condition that you want.&#x20;

{% hint style="info" %}
***Find Best Match** is used when you want to find the closest match in the user response to the content we have in your database.*

***Equals** can be used when you want to match the condition with the user’s response.*&#x20;
{% endhint %}

Continuing with the above example, we will take Switch type ad “**Find Best Match**”.

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FX1LVjSoXRlJUtUxrlKn5%2FMatch%20Type%20-%20Switch%20card.png?alt=media&#x26;token=deda7e9c-e4a7-4e9f-9cff-7028a2a0b472" alt=""><figcaption><p>Selecting Switch Type</p></figcaption></figure>

2. **Input:**

The Input acts as the data on which the condition will be applied. You can add any variable that you have declared with the greeting message or can add intent, recipient details, contact fields&#x20;

In continuation with the example, we are taking the input as a custom variable - *test\_product* declared in the greeting message.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2F2zBa54R5XuYiDL4Jnany%2FInput-%20Switch%20Card.png?alt=media&#x26;token=cd5ca4a6-5777-4c01-b9fc-a09255dc6399" alt=""><figcaption><p>Selecting the preferred Input</p></figcaption></figure>

3. **Rating Threshold:**

It depicts how similar is the response you received from the user in fraction from 0 to 1 (both inclusive). The higher fraction shows high similarity. We’ll take the rating threshold to 0.2.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FIgpMydyrIICJkmYy0WFy%2FRating%20Threshold%20-%20Switch%20Card.png?alt=media&#x26;token=f0d83206-7c95-4688-b5a8-4840500f3eac" alt=""><figcaption><p>Adding the Rating Threshold</p></figcaption></figure>

4. **Match:**

Here you have to add the condition to which the response will be evaluated. Continuing the example, we are adding  three product categories: electronics, clothing, and home décor. You can add as many categories as you want.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2F6PGHju46BGyJxrE8ktb1%2FMatch%20-%20Switch%20Card.png?alt=media&#x26;token=1d87246b-fce7-42c7-b780-90882cdad444" alt=""><figcaption><p>Adding the conditions (Match)</p></figcaption></figure>

#### This is how the chat-flow will look like after:&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FfZEmSrSkaLJEKeM7tFrX%2FSwitch%20card%20in%20chat-flow.png?alt=media&#x26;token=732b0519-0f84-4e0a-819f-484e56a4794c" alt=""><figcaption><p>Switch Card in the chat-flow</p></figcaption></figure>

You can create different journey’s for the keywords you chose. There will be one default keyword that will get triggered when the switch card is not able to capture the user response according to the condition provided.&#x20;

In the above example, if the user responded with groceries, the default journey will get triggered for that particular user.&#x20;
