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

# Transformations

> Learn how to transform data using JSONata expressions in Streemlined pipelines

Streemlined uses [JSONata](https://jsonata.org/) for data transformation. JSONata is a lightweight query and transformation language for JSON.

## Basic Syntax

```jsonata theme={null}
/* Access fields */
customer.name

/* Transform structure */
{
  "fullName": customer.firstName & " " & customer.lastName,
  "orderTotal": items.price ~> $sum()
}

/* Filter arrays */
items[price > 100]

/* Conditional logic */
status = "premium" ? discount * 0.2 : discount * 0.1
```

## Variables

You can define variables for reusable logic:

```jsonata theme={null}
(
  $taxRate := 0.08;
  $subtotal := items.price ~> $sum();
  {
    "subtotal": $subtotal,
    "tax": $subtotal * $taxRate,
    "total": $subtotal * (1 + $taxRate)
  }
)
```

## Built-in Functions

JSONata provides many built-in functions:

* [String Functions](https://docs.jsonata.org/string-functions)
* [Numeric Functions](https://docs.jsonata.org/numeric-functions)
* [Aggregation Functions](https://docs.jsonata.org/aggregation-functions)
* [Boolean Functions](https://docs.jsonata.org/boolean-functions)
* [Array Functions](https://docs.jsonata.org/array-functions)
* [Object Functions](https://docs.jsonata.org/object-functions)
* [Date/Time Functions](https://docs.jsonata.org/date-time-functions)

Examples:

| Function       | Description       | Example                 |
| -------------- | ----------------- | ----------------------- |
| `$sum()`       | Sum array values  | `items.price ~> $sum()` |
| `$count()`     | Count items       | `$count(items)`         |
| `$now()`       | Current timestamp | `$now()`                |
| `$string()`    | Convert to string | `$string(id)`           |
| `$number()`    | Convert to number | `$number(amount)`       |
| `$lowercase()` | Lowercase string  | `$lowercase(name)`      |

<Tip>
  There are truly amazing playgrounds to help familiarize yourself with JSONata:

  * [JSONata Studio](https://jsonatastudio.com/playground) (Recommended)
  * [Try JSONata](https://try.jsonata.org/)
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="Visual Editor" icon="window" href="/editor">
    Learn to build pipelines in the UI
  </Card>

  <Card title="Nodes Reference" icon="diagram-project" href="/nodes">
    Explore all available processing nodes
  </Card>
</CardGroup>
