> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oration.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Transform

> Transform data values with string, number, and JSON operations

The **Transform** node modifies a variable's value using one of 12 built-in transformation types. It reads from an input variable, applies the transformation, and stores the result.

## Behavior

* Reads the value from the specified input variable
* Applies the selected transformation with optional parameters
* Stores the result in the `result` output variable
* Routes to `Success` or `Error` based on the outcome

## Configuration

| Parameter       | Type   | Default      | Description                                          |
| --------------- | ------ | ------------ | ---------------------------------------------------- |
| `inputVariable` | string | `""`         | Variable to read the input value from                |
| `transformType` | enum   | `"to_upper"` | Transformation to apply (see table below)            |
| `params`        | object | `{}`         | Additional parameters specific to the transform type |

### Transform types

| Type             | Description                           | Relevant params                             |
| ---------------- | ------------------------------------- | ------------------------------------------- |
| `to_upper`       | Convert to uppercase                  | —                                           |
| `to_lower`       | Convert to lowercase                  | —                                           |
| `trim`           | Remove leading/trailing whitespace    | —                                           |
| `replace`        | Find and replace text                 | `pattern`, `replacement`                    |
| `substring`      | Extract a portion of the string       | `startIndex`, `endIndex`                    |
| `split`          | Split string into an array            | `separator`                                 |
| `join`           | Join array elements into a string     | `separator`                                 |
| `json_parse`     | Parse a JSON string into an object    | —                                           |
| `json_stringify` | Convert an object to a JSON string    | —                                           |
| `number_format`  | Format a number with decimal places   | `numberFormat` (0–5 decimal places)         |
| `date_format`    | Format a date value                   | `dateFormat` (`ISO`, `locale`, `timestamp`) |
| `regex_extract`  | Extract text matching a regex pattern | `pattern`                                   |

### Params reference

| Param          | Type   | Description                                                     |
| -------------- | ------ | --------------------------------------------------------------- |
| `pattern`      | string | Regex pattern or search string (for `replace`, `regex_extract`) |
| `replacement`  | string | Replacement string (for `replace`)                              |
| `separator`    | string | Delimiter (for `split`, `join`)                                 |
| `startIndex`   | number | Start index for `substring`                                     |
| `endIndex`     | number | End index for `substring`                                       |
| `dateFormat`   | enum   | Date format: `ISO`, `locale`, `timestamp`                       |
| `numberFormat` | number | Decimal places (0–5) for `number_format`                        |

## Output handles

| Handle      | Description                                      |
| ----------- | ------------------------------------------------ |
| **Success** | Transformation completed successfully            |
| **Error**   | Transformation failed (e.g., invalid input type) |

## Output variables

| Variable | Type | Description           |
| -------- | ---- | --------------------- |
| `result` | any  | The transformed value |

## Use cases

<AccordionGroup>
  <Accordion title="Normalize input">
    After Speech Input, use `trim` then `to_lower` to clean up the transcript before using it in a Condition node.
  </Accordion>

  <Accordion title="Parse API response">
    After an API Call, use `json_parse` to convert the response body string into an object, then use `regex_extract` to pull specific fields.
  </Accordion>

  <Accordion title="Format currency">
    Use `number_format` with `numberFormat: 2` to display an account balance as `1234.56` in a TTS message.
  </Accordion>
</AccordionGroup>
