> For the complete documentation index, see [llms.txt](https://docs.fortifiedid.se/pipes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fortifiedid.se/pipes/valves/item/item-property-copy.md).

# Item Property Copy

Valve for copying item properties. The operation is performed on one item at a time and does not support copying between items.<br>

Use `item_include_expr` to control which items are processed (see [Item](/pipes/valves/item.md)).

## Configuration

{% hint style="info" %}
**Valve name:**  `ItemPropertyCopy`
{% endhint %}

{% tabs %}
{% tab title="Properties" %}

<table><thead><tr><th width="133">Name</th><th width="282">Description</th><th width="152">Default value</th><th width="128" data-type="checkbox">Mandatory</th><th width="119" data-type="checkbox">Expanded</th></tr></thead><tbody><tr><td><code>src</code></td><td>Property to copy from.</td><td></td><td>true</td><td>true</td></tr><tr><td><code>dest</code></td><td>Property to copy to.</td><td></td><td>false</td><td>true</td></tr><tr><td><code>replace</code></td><td>Replace destination. If true existing value of dest will be replaced with new values (overwritten), otherwise new values will be added.</td><td><code>false</code></td><td>false</td><td>false</td></tr><tr><td><code>filter</code></td><td>Include value predicate. Expression controlling if a value should be copied or not. If not specified, all values are copied. For more information see below.</td><td></td><td>false</td><td>true</td></tr></tbody></table>
{% endtab %}

{% tab title="Example" %}

```json
{
    "name":"ItemPropertyCopy",
    "config":{
        "item_include_expr": "item.id.startsWith('tmp_')",
        "src": "from",
        "dest": "to",
        "replace": false,
        "filter": "value !== ''"
    }
}
```

{% endtab %}
{% endtabs %}

### Include value predicate

Predicate expression that determines whether a value should be copied. The expression is written in JavaScript and must return `true` (to copy the value) or `false` (to skip it).

#### Scopes

The following scopes are available:

<table><thead><tr><th width="145">Name</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>value</td><td>The current value</td><td><code>"value.startsWith('__')"</code></td></tr><tr><td>item</td><td>The current item</td><td><code>"item.id === 'tmp'"</code></td></tr><tr><td>session</td><td>The current session</td><td><code>"session.addProp === true"</code></td></tr><tr><td>state</td><td>The current pipe state</td><td><code>"state.itemComplete === false"</code></td></tr><tr><td>request</td><td>The current pipe (NOT HTTP) request. Contains all parameters sent to the pipe.</td><td><code>"request.username != null"</code></td></tr><tr><td>items</td><td>The current set of items</td><td><code>"items.size > 1"</code></td></tr><tr><td>exports</td><td>The current exported (from authenticators or other valves) properties</td><td><code>"!exports.done"</code></td></tr></tbody></table>

{% hint style="info" %}
Since item properties are multi valued, values must be indexed (`item.value[0]`) in expressions or use functions from the mv extension library (`mv.contains(item.value, 'value')`).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fortifiedid.se/pipes/valves/item/item-property-copy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
