Hi Fabio Carello ,
Thankyou for using Microsoft Q&A platform and thanks for posting your question here.
As I understand your query , you want to flatten json data coming from REST API endpoint, however, your query is that for one of the REST API , you are not able to flatten the data since it's coming as complex datatype and not array datatype which is making it difficult to unroll by. Please correct me if my understanding is wrong.
Your understanding is correct regarding the possible approach to use aggregate transformation with collect function which basically collects all values of the expression in the aggregated group into a array . There is no direct way to achieve this as cast transformation doesn't have array as the datatype in option.
Other way to achieve this could be to use derived column transformation and use split function which splits a string based on a delimiter and returns an array of strings . It allows to select the body[] for unroll by in flatten transformation.
For similar scenario, kindly check this post: Flatten and Parsing Json using Azure Data Flow
Hope it helps. Kindly accept the answer by clicking on Accept answer button. Thankyou





