The array is currently being treated as a string. Because the square brackets inside req_array
indicate that the array is being treated as a string rather than a JSON array. To fix this, use the toJSON()
function in a Derived Column transformation
before passing the data to the External Call transformation.
In the Derived Column transformation
, apply:
toJSON(yourColumnName)
This ensures the column retains its JSON structure instead of being converted to a string.
The Flatten transformation
in ADF Data Flow to break the array into individual rows, ensuring each object is processed separately. Then, apply the Aggregate transformation
to regroup the data into a JSON array without adding a column name, preserving the correct API payload structure.
The below Microsoft docs will be helpful for reference
https://learn.microsoft.com/en-us/azure/data-factory/data-flow-expression-functions#tojson
https://learn.microsoft.com/en-us/azure/data-factory/data-flow-aggregate
https://learn.microsoft.com/en-us/azure/data-factory/data-flow-flatten
https://www.youtube.com/watch?v=PieRpstpRJg
Disclaimer: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
I hope this information helps. Please do let us know if you have any further queries.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.
Thank you.