Skip to main content
The “Recursively copy values to children” transformer can copy a value from an entity to a nested/child property within the same entity data. It does so recursively if the nested/child property contains the same properties. For example, it allows to copy a product identifier from a main product to a list of sub products.

Fields

Pattern to children within a parent

A required field. The path in the entity data where to copy to data to.

Mapping of values from parent to child

A required field. The data structure to copy to the children/nested data. Supports placeholders to reference data from the parent.

Keep using the context from the first level

Determines whether the placeholders will reference data from the parent, or from the current child element.

Sample data

Input data:
{ 
  "product": "T-Shirt", 
  "identifier": 1234, 
  "variants": [ 
    { 
      "name": "Red" 
    }, 
    { 
      "name": "Blue" 
    } 
  ] 
} 
Pattern to children within a parent: variants.* Mapping of values from parent to child:
{ 
  "parent": "&{identifier}" 
} 
Keep using the context from the first level: Yes Output:
{ 
  "product": "T-Shirt", 
  "identifier": 1234, 
  "variants": [ 
    { 
      "name": "Red", 
      "parent": 1234 
    }, 
    { 
      "name": "Blue", 
      "parent": 1234 
    } 
  ] 
}