# Switch / Case

## ![](/files/bgLUQKxbrlnQJzuSGfpj) Switch / Case

### Description <a href="#description" id="description"></a>

The Switch Case transform implements the [Switch/Case statement](https://en.wikipedia.org/wiki/Switch_statement) found in popular programming languages like Java.

In our case we route rows of data to one or more target transforms based on the value encountered in a certain field.

| Hop Engine | <sup>✓</sup> |
| ---------- | ------------ |
| Spark      | ?            |
| Flink      | ?            |
| Dataflow   | ?            |

### Options

| Option                         | Description                                                                                                                                                                                                                                           |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Transform name                 | The name that uniquely identifies the transform.                                                                                                                                                                                                      |
| Field name to switch           | The field name that contains the value to use as a bases for the row routing.                                                                                                                                                                         |
| Use string contains comparison | If checked, the comparison will be true if the value is found anywhere in the field being tested. Unchecked and the value has to exactly match the field.                                                                                             |
| Case value data type           | The data type of the values specified in this dialog                                                                                                                                                                                                  |
| Case value conversion mask     | The conversion mask of the values specified in this dialog (numeric / date values)                                                                                                                                                                    |
| Case value decimal symbol      | The decimal symbol of the values specified in this dialog (numeric values)                                                                                                                                                                            |
| Case value grouping symbol     | The grouping symbol of the values specified in this dialog (numeric values)                                                                                                                                                                           |
| Case values                    | Here you can specify a value-target transform pair, one per row. To specify a null value, simply leave the value column blank while entering a target transform. Please note that it is possible to specify the same target transform more than once. |
| Default target transform       | All the rows that don’t match any of the case values above are sent to this target transform.                                                                                                                                                         |


---

# 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://docs.primeur.com/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/switchcase.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.
