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