DataWeave – Transform Nested Structure to Flat using map and flatten

Nested Json to Flat Json This example show usage of DataWeave to transform nested json structure to flat json structure. i break them into step 1 and 2 to better illustrate the transformation. Input Json:

After Step 1: