> For the complete documentation index, see [llms.txt](https://docs.laminar.run/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.laminar.run/building-an-integration/advanced/flows/flow-types/data-transformations.md).

# Data Transformations

Transformations allow you to modify data before or after making HTTP requests. They are written as JavaScript arrow functions and have access to specific libraries to help with data manipulation. The following imports are available:

```
* lodash as _
* date-fns: { format, parseISO }
```

### Example: Format User Names

Let's start with a basic transformation that formats user names to uppercase:

```javascript
// Transform user names to uppercase
(payload) => {
  const users = payload.step_2.response
  return users.map(user => ({
    ...user,
    name: user.name.toUpperCase()
  }));
}
```

### Example: Filter and Enrich Orders

This example filters out canceled orders and adds formatted date strings:

```javascript
// The `format` function is already available, no need to import
(payload) => {
  const orders = payload.input
  return orders
    .filter(order => order.status !== 'canceled')
    .map(order => ({
      ...order,
      formattedDate: format(new Date(order.createdAt), 'MMM dd, yyyy')
    }));
}
```
