Skip to main content
Monika Paygude 님이 #MuleSoft DataWeave에 질문했습니다

Sample Input:

[{ "name": "monika", "id": 12, "add": {  "city": "pune",  "country": "IND" }, "ref": [  {  "ref1": "abc",  "ref2": "xyz"  },  {  "ref1": "ABC",  "ref2": "XYZ"  } ] }]

 

Expected Output:

 

name,id,add/city,add/country,ref/ref1/0,ref/ref2/0,ref/ref1/1,ref/ref2/1

monika,12,pune,IND,abc,xyz,ABC,XYZ

 

Tried with below dataweave , but getting issue with array of objects.

There should be an index in key of array of objects.

e.g. ref/ref1/0 for 0th object

ref/ref1/1 for 1st object

 

Transform JSON array to excel sheet in Mule 3

 

Please help me with Dataweave 1.0 script.

0/9000