Convert Array To String In Dataweave 2.0

 

You can use joinBy Dataweave 2.0 function to convert array to string

Example

Input:

[1,2,3,4,5]

 

Dataweave Expression:

%dw 2.0
output application/json
---
{
	"a": payload joinBy ("-")
}

Result:

{
	"a": "1-2-3-4-5"
}

 

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments