I am new to mule and I am unable to transform this nested array to my required format. I searched various links but couldn't find much help relevant to my requirement. I am attaching the snippet which I have tried till now and I am unable to figure out how to proceed further.
Code
%dw 2.0
output application/json
var myvar={
"name" : ["Shawn","James","Paul"],
"sd" : ["2020-12-23","2020-12-24","2020-12-24"],
"ed" : ["2020-12-25","2020-12-28","2020-12-27"]
}
---
myvar.name zip myvar.sd zip myvar.ed
Required Output
[
{
'name': "shawn",
'sd': "2020-12-23",
'ed': "2020-12-25"
},
{
'name': "james",
'sd': "2020-12-24",
'ed': "2020-12-28"
},
{
'name': "Paul",
'sd': "2020-12-24",
'ed': "2020-12-27"
}
]
Actual Output
[
[
[
"Shawn",
"2020-12-23"
],
"2020-12-25"
],
[
[
"James",
"2020-12-24"
],
"2020-12-28"
],
[
[
"Paul",
"2020-12-24"
],
"2020-12-27"
]
]
Any sort of guidance or hint or any relevant links would be very helpful to me.