If you have an array within an array in a record and you want to transform, use the following example:
Input:
{ "Items": [ { "Name": "perfume", "Price": 50, "Flavors": [ { "Weight": 3.14, "Scent": "Obsession", "Color": “black” }, { "Weight": 3.41, "Scent": "Cool waters", "Color": "Black" } ] }
Rules:
Source data (input) | Transformed data (output) |
---|---|
items[*].name | products[*].name |
items[*].price | products[*].price |
items[*].flavors[*].weight | products[*].weight |
items[*].flavors[*].scent | products[*].scent |
items[*].flavors[*].color | products[*].color |
Output:
{ "products": [ { "color": "Black", "scent": "Obsession", "weight": 3.14, "name": "perfume", "price": 50 }, { "color": "Black", "scent": "Cool waters", "weight": 3.41, "name": "perfume", "price": 50 } ] }
Comments
Please sign in to leave a comment.