> For the complete documentation index, see [llms.txt](https://docs.hablla.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hablla.com/hablla-docs-en/automation-flows/all-components/data-transformation/multiple-selection.md).

# Multiple Selection

### Overview

The **Conditional Switch Case Component** (identified in the system by the technical name `switch_case`) is a flow control node focused on multi-level routing and complex data segmentation. Its main function is to go beyond the binary branching of the traditional IF component, allowing the automation to evaluate a single variable or expression against multiple test scenarios (*cases*) simultaneously. When processing the contact, the system checks the condition blocks from top to bottom and directs the user specifically to the output port of the first criterion that returns a positive result.

### Configuration Parameters

The node parameterization operates through a dynamic list of validations grouped under the section *Label and expression*:

* **Title:** The name or descriptive label given to that specific condition (e.g., "Score 4 or 5"). This text serves to organize the visual editor and name the corresponding physical output port.<br>
* **Expression:** Structured field for receiving validation formulas enclosed by double curly brace syntax `{{ ... }}`. It is the mathematical or textual criterion that determines the success of the branching.<br>
* **Button + Add option:** Management control that inserts a new pair of fields (*Title* + *Expression*) in the component check list.<br>
* **Trash Icon:** Quick delete button fixed in the upper-right corner of each option block to remove obsolete rules from the node.<br>

### Visual Builder

The builder interface is designed vertically and modularly, adapting the graphical connection map to the volume of rules inserted by the administrator:

* **Mapping Multiple Output Ports:** Unlike common nodes, the physical morphology of this block in the flow design editor is completely mutable. Each new option added by the *+ Add option* button generates a new corresponding side output port, identified exactly by the text entered in the field *Title*.<br>
* **Default Output Block (Fallback):** As displayed at the bottom of the interface of `image_3b7aa4.png`, the last option is configured as a "Fallback" (or escape route). It has the *Expression* field intentionally left empty. If the contact goes through all previous expressions and none match, the engine automatically triggers the output port of the *Fallback* to prevent the customer from getting stuck in the flow.<br>

### Special Operators

The logical properties of this component manage continuous syntactic validation and native string analysis methods in JavaScript:

* **Character Inclusion Analysis (`.includes()`):** As illustrated in the panel, the interpreter accepts modern string validation methods, such as `{{$data?.first_message.includes("4") || $data?.first_message.includes("5")}}`. The method `.includes()` checks whether the term entered by the user contains that specific character anywhere in the sentence, rather than requiring an exact match.<br>
* **Linear Cascade Prioritization:** The engine processes the rules in a strictly linear way (from top to bottom). If a contact matches criteria 1 and criteria 2 simultaneously, the system will route through path 1 because of the reading order, ignoring the lower checks.<br>
* **Instant Synchronous Computation:** Just like the IF component, the Switch Case is resolved in microseconds directly in server memory, distributing contacts across the output ports asynchronously and instantly.<br>

### Practical Examples

The table below shows classic scenarios for configuring expressions to create intelligent service distributions on the platform:

| **Option Title (Output)** | **Configured JavaScript Expression**       | **Type of Validation Performed**        | **Practical Use Case**                                                                                                                                                            |                                                                                                                                       |
| ------------------------- | ------------------------------------------ | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **Score 4 or 5**          | \`{{$data?.first\_message.includes("4") \\ | $data?.first\_message.includes("5")}}\` | Partial character search in string (OR).                                                                                                                                          | Analyze the score entered by the customer in a quick survey. Scores 4 or 5 direct the contact to the very satisfied customers output. |
| **Score 3**               | `{{$data?.first_message.includes("3")}}`   | Partial character search in string.     | Identifies users who gave a neutral score (3) to send them to a branch of service focused on improvements.                                                                        |                                                                                                                                       |
| **Score 1 or 2**          | \`{{$data?.first\_message.includes("1") \\ | $data?.first\_message.includes("2")}}\` | Partial character search in string (OR).                                                                                                                                          | Immediately isolate dissatisfied customers (scores 1 or 2) to direct the contact with maximum priority to the human retention queue.  |
| **Fallback**              | *Empty (No expression)*                    | Automatic escape route by exclusion.    | If the customer types random text or a score outside the standard (e.g., "liked it"), the system takes the Fallback output to send a message asking them to enter a valid number. |                                                                                                                                       |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.hablla.com/hablla-docs-en/automation-flows/all-components/data-transformation/multiple-selection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
