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

# map

### Introduction

The `map` filter allows you to apply a function to each item in a collection (such as arrays or objects), returning a new collection with the results. This filter is useful for transforming elements in a collection in a simple and efficient way.

> **Note:** The `map` filter works exclusively through Automations, Campaigns, and Advanced Campaigns.

### Example of Use

Example of how to use the `map` filter to multiply each number in an array by 2:

```twig theme={null}
{% set numbers = [1, 2, 3, 4, 5] %}
{% set doubled = numbers|map(n => n * 2) %}
{{ doubled|join(', ') }}
```

In this example, the `numbers` array is transformed using the `map` filter, which applies the multiplication function to each element. The result is a new array `[2, 4, 6, 8, 10]`, which is then converted into a **string** with the numbers separated by commas.

### Output Example of the Code

<img src="https://mintcdn.com/reportana/Jha6odPLZMMTun1e/map-en.png?fit=max&auto=format&n=Jha6odPLZMMTun1e&q=85&s=905d145376ea63057b4a6c8bc46eda50" alt="Result of `map` Filter" width="188" height="72" data-path="map-en.png" />
