How to convert Array to String using Mule 4 Dataweave

Let us see how can we convert a JSON array into the string using Dataweave in Mule 4. I have given two examples to explain How to convert an array into a string using Dataweave.

Also See: Mule 4 Dataweave 2.0 code to convert a String to JSON output



Converting complete JSON array into a string using Dataweave:


%dw 2.0
output application/json
--
write(payload."Books Info",'application/json')

Output:


Convert array from an Object string using Dataweave 2.0

%dw 2.0
output application/json
---
payload.Author joinBy ","

Output:








Post a Comment

0 Comments