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

# Copy using an accessor

> Copies a part of the entity data to another location within the entity data, while leaving the original content unchanged.

Copies a part of the entity data to another location within the entity data, while leaving the original content unchanged. Instead of pointing at a single fixed path, you choose a way of reading values for the source and a way of writing values for the destination. That lets you copy several matching values at once, such as every product SKU in an order, and place them all under a new location in one step. If you do not need to keep the original, use [Move using an accessor](/references/transformer/accessor-move) instead.

This documentation describes: [Schema](/schemas/transformer/accessor-copy)

## Fields

**Source**

Required

The way of reading the values you want to copy. Every value this reads is copied to the destination. For example, a pattern accessor matching `order.items.*.sku` reads the SKU of every item in an order.

See the [accessor](/references/accessor) reference.

**Destination**

Required

The way of writing the copied values into the entity. For example, a key accessor with a root of `skus` places the values under a new `skus` location.

See the [accessor](/references/accessor) reference.

**Strip enclosures from keys**

Optional

Controls how a source path that contains dots is treated at the destination. When on (the default), a path such as `order.items.0.sku` is read as a nested path, so the copied value keeps that nested structure under the destination. When off, the whole path is kept as a single literal key. Leave it on unless you specifically want the dotted path preserved as one key.

## Sample data

| Field | Value |
| - | - |
| Source | Pattern accessor matching `order.items.*.sku` |
| Destination | Key accessor with root `skus` |
| Strip enclosures from keys | On (default) |

Input:

```json theme={null}
{
    "order": {
        "items": [
            { "sku": "A1", "qty": 2 },
            { "sku": "B2", "qty": 5 }
        ]
    }
}
```

Output:

```json theme={null}
{
    "order": {
        "items": [
            { "sku": "A1", "qty": 2 },
            { "sku": "B2", "qty": 5 }
        ]
    },
    "skus": {
        "order": {
            "items": [
                { "sku": "A1" },
                { "sku": "B2" }
            ]
        }
    }
}
```

The original `order.items` is untouched, and a copy of every matched SKU now also lives under the new `skus` location, keeping the path it came from.

```json Configuration theme={null}
{
  "prototype": "accessor-copy",
  "parameters": {
    "source": { "prototype": "pattern", "parameters": { "pattern": "order.items.*.sku" } },
    "destination": { "prototype": "key", "parameters": { "root": "skus" } }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.