In SnapLogic, is there is simple way to take the first JSON record and produce the output that is shown afterwards?
This is a simplified version of what is trying to be achieved...
The input record contains two variables and an array of "skus" consisting of items with two variables, a "skucode" and a "shade".
Each output record is a superset of the input record. Each output record promotes one of the array items above the array to the same level as the two variables in the input record, as shown in the example below.
Input:
{
"code": "ABCD",
"name": "Product A",
"sku": [
{
"skucode": "ABCD12",
"shade": "green"
},
{
"skucode": "ABCD13",
"shade": "brown"
},
{
"skucode": "ABCD14",
"shade": "blue"
},
{
"skucode": "ABCD15",
"shade": "red"
},
]
}
Output:
[{
"code": "ABCD",
"name": "Product A",
"skucode": "ABCD12",
"shade": "green"
"sku": [
{
"skucode": "ABCD12",
"shade": "green"
},
{
"skucode": "ABCD13",
"shade": "brown"
},
{
"skucode": "ABCD14",
"shade": "blue"
},
{
"skucode": "ABCD15",
"shade": "red"
},
]
},
{
"code": "ABCD",
"name": "Product A",
"skucode": "ABCD13",
"shade": "brown"
"sku": [
{
"skucode": "ABCD12",
"shade": "green"
},
{
"skucode": "ABCD13",
"shade": "brown"
},
{
"skucode": "ABCD14",
"shade": "blue"
},
{
"skucode": "ABCD15",
"shade": "red"
},
]
},
{
"code": "ABCD",
"name": "Product A",
"skucode": "ABCD14",
"shade": "blue"
"sku": [
{
"skucode": "ABCD12",
"shade": "green"
},
{
"skucode": "ABCD13",
"shade": "brown"
},
{
"skucode": "ABCD14",
"shade": "blue"
},
{
"skucode": "ABCD15",
"shade": "red"
}
]
},
{
"code": "ABCD",
"name": "Product A",
"skucode": "ABCD15",
"shade": "red"
"sku": [
{
"skucode": "ABCD12",
"shade": "green"
},
{
"skucode": "ABCD13",
"shade": "brown"
},
{
"skucode": "ABCD14",
"shade": "blue"
},
{
"skucode": "ABCD15",
"shade": "red"
}
]
}
]