title: Dataweave 2 - Output multiple JSON by line
body: <p>My <strong>input</strong> is a <strong>Array of Objects</strong> that I want to <strong>map</strong> to a <strong>JSON object</strong>.</p>
  
  <p>I want <strong>each JSON object to be line per line</strong> and the JSON set in the <strong>same payload</strong>.</p>
  
  <p>My Dataweave code:</p>
  
  <pre><code> %dw 2.0
   output application/json indent = false
   ---
   payload map (payload, indexOfPayload ) -&gt; {
       id: payload.externalid_c,
       surname: payload.surname__c
           platform: payload.platform__c
   }
  </code></pre>
  
  <p>Example output I want:</p>
  
  <pre><code> {"id": "demo", "surname": "anypoint", "platform": "testing"}
   {"id": "demo2", "surname": "studio", "platform": "apple"}
   {"id": "demo3", "surname": "windows", "platform": "microsoft"}
  </code></pre>