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

# Map Keys For Each

> Apply the same key-path mappings to every object in a list.

The **Map Keys For Each** action renames or moves paths in every object in a
list. It preserves list order and returns newly copied objects.

## Inputs

| Input            | Type            | Required  | Description                                  |
| ---------------- | --------------- | --------- | -------------------------------------------- |
| **Array**        | List of objects | Yes       | The objects to transform.                    |
| **Key Mappings** | Mapping entries | No        | Old and new path pairs applied to each item. |
| **Old Key**      | String          | Per entry | The existing key or nested path.             |
| **New Key**      | String          | Per entry | The destination key or nested path.          |

## Outputs

| Output     | Type            | Description                                      |
| ---------- | --------------- | ------------------------------------------------ |
| **Result** | List of objects | The transformed objects in their original order. |

## Example

Map `first_name` to `name` for:

```json theme={null}
[
  { "first_name": "Ada", "id": 1 },
  { "first_name": "Grace", "id": 2 }
]
```

The result is:

```json theme={null}
[
  { "name": "Ada", "id": 1 },
  { "name": "Grace", "id": 2 }
]
```

Nested paths are supported, and missing old paths are skipped for only the
objects that lack them.

<Warning>
  Mappings run in order on each object. Existing destination values can be
  overwritten, and overlapping mappings can affect one another.
</Warning>
