How can I flatten an array of JSONs that contain another array inside it, in the copy activity. I review the forumns and samples. I've already tested many approaches, but it seems my JSON is very complecated. This is the JSON:
{
"results": [{
"label": "CA - SF",
"disOrd": 6,
"id": "1234",
"stages": [{
"label": "R D",
"disOrd": 0,
"metadata": {
"isClosed": "true",
"probability": "0.0"
},
"id": "567",
"createdAt": "2023-05-22T13:31:50.317Z",
"updatedAt": "2023-05-30T16:07:47.170Z",
"arch": false,
"writePer": "CRM"
}, {
"label": "P D",
"disOrd": 1,
"metadata": {
"isClosed": "true",
"probability": "0.0"
},
"id": "890",
"createdAt": "2022-10-21T10:04:15.298Z",
"updatedAt": "2023-05-30T16:07:47.170Z",
"arch": false,
"writePer": "CRM"
}
],
"createdAt": "2021-07-19T16:06:35.682Z",
"updatedAt": "2023-05-30T16:07:47.170Z",
"arch": false
}, {
"label": "IO",
"disOrd": 14,
"id": "2345",
"stages": [{
"label": "P-D",
"disOrd": 0,
"metadata": {
"isClosed": "true",
"probability": "0.0"
},
"id": "987",
"createdAt": "2023-05-30T16:06:22.624Z",
"updatedAt": "2023-05-30T16:06:22.624Z",
"arch": false,
"writePer": "CRM"
}, {
"label": "I C",
"disOrd": 1,
"metadata": {
"isClosed": "false",
"probability": "0.05"
},
"id": "876",
"createdAt": "2020-04-15T16:17:02.063Z",
"updatedAt": "2023-05-30T16:06:22.624Z",
"arch": false,
"writePer": "CRM"
}, {
"label": "GI",
"disOrd": 2,
"metadata": {
"isClosed": "false",
"probability": "0.25"
},
"id": "543",
"createdAt": "2020-04-15T16:17:02.063Z",
"updatedAt": "2023-05-30T16:06:22.624Z",
"arch": false,
"writePer": "CRM"
}
],
"createdAt": "2020-04-15T16:17:02.063Z",
"updatedAt": "2023-05-30T16:06:22.624Z",
"arch": false
}
]
}
I want to copy the flatten JSON into a csv file. I used a varaible that has the dynamic mapping in the copy activity, then its index has been changed in a loop but the problem occured with double quotes. Is there any solution?










