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.

Use item_include_expr to control which items are processed (see Item).

Configuration

Valve name: ItemPropertyCopy

Name
Description
Default value
Mandatory
Expanded

src

Property to copy from.

dest

Property to copy to.

replace

Replace destination. If true existing value of dest will be replaced with new values (overwritten), otherwise new values will be added.

false

filter

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.

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:

Name
Description
Example

value

The current value

"value.startsWith('__')"

item

The current item

"item.id === 'tmp'"

session

The current session

"session.addProp === true"

state

The current pipe state

"state.itemComplete === false"

request

The current pipe (NOT HTTP) request. Contains all parameters sent to the pipe.

"request.username != null"

items

The current set of items

"items.size > 1"

exports

The current exported (from authenticators or other valves) properties

"!exports.done"

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')).