Search code examples
muleesbmule-componentmule-eldataweave

I am trying to append a map to a map of same Name in Mule . But the the values are getting overwritten


I am trying to append a map to a map with the same Name in Mule Dataweave, but the the values are getting overwritten.

First map Just after this I am trying to map other values that I store in flow vars:

Second Image

Basically, say if there are 11 records already populated in 010_HL_Loop element through the 1st loop, I want the next loop to start from the 11th 10_HL_Loop element and add other map elements to it.


Solution

  • Can you try with this snippet in dataweave

    %dw 1.0
    %output application/java
    ---
    flatten (payload ++ flowVars.getVehicleInfo)
    

    You need to make sure that both the payload and the flow variable are an array