Hi there
I have following json
[
{
"quantity": [
"3.0",
"4.0",
"2.0"
],
"order-header-id": [
"16737",
"16737",
"16737",
],
"line-num": [
"1",
"2",
"3",
],
"coupalineAttacments": [
{
"id": {
"@type": "integer",
"$": "1878040"
},
"text": "OIL"
},
{
"id": {
"@type": "integer",
"$": "1878042"
},
"text": "SURGE TRAP "
}
]
}
]
that I need to convert it into multiple records based on line-num
[
{
"quantity" : "3.0",
"order-header-id": "16737",
"line-num": "1",
"coupalineAttacments":
{
"id": {
"@type": "integer",
"$": "1878040"
},
"text": "OIL"
}
}
{
"quantity" : "4.0",
"order-header-id": "16737",
"line-num": "2",
"coupalineAttacments":
{
"id": {
"@type": "integer",
"$": "1878042"
},
"text": "SURGE TRAP "
}
}
{
"quantity" : "2.0",
"order-header-id": "16737",
"line-num": "3",
"coupalineAttacments": ""
}
]
I have tried mapValues also map but doesnt look I am doing right. any guidance.
thanks
Manohar