Skip to main content
Takes a part of the entity data and moves it to a new location in the entity data. This transformer can be used to move the value of a key, or a nested key, like “product”, or “product.name” into a new key like “itemName”, or “item.itemName”.

Fields

Pattern

A required field. The path towards the entity data that needs to be moved.

Replacement

A required field. The output location where the data will be moved to.

Conditions

Only move the data when a certain condition is met.

Sample data

  • Pattern: product.name
  • Replacement: product_name
Input:
{
    “product”: {
        “name”: “example”
    } 
} 
Output:
{
    “product_name”: “example” 
} 

  • Pattern: products.*.name
  • Replacement: product_names.$1
Input:
{
  “products”: [ 
    {“name”: ”example”}, 
    {“name”: ”example2"} 
  ] 
} 
Output:
{  
    “product_names”: [ 
        “example”, 
        “example2” 
    ] 
} 

  • Pattern: products.*.categories.*
  • Replacement: categories.$2
Input:
{ 
    "products": [ 
        { 
            "name": "example",
            "categories": [1, 2, 3] 
        }
    ]
} 
Output:
{ 
    "products": [ 
        {
          "name": "example", 
          "categories": [] 
        }
    ],
    "categories": [1, 2, 3]
}