I am using Anypoint Studio 6.1 and Mule 3.8.1 and am mapping JSON to JSON in Dataweave. In the JSON mapping I have an optional field called "Channels" which contains a list of strings. When the field is not there I get a warning in Dataweave. How can I write the Dataweave code to ignore if its null?
Dataweave code:
%dw 1.0
%output application/json skipNullOn="everywhere"
---
payload map ((payload01 , indexOfPayload01) -> {
Channels: payload01.Channels map ((channel , indexOfAccessChannel) -> channel)
})
I have tried to use "when" and also the "?" selector modifier but cannot get the syntax right.
Thanks