Forget about serialization formats and focus on your logic: DataWeave will handle the specifics of JSON, XML, CSV, YAML, and many more.
[ { "firstName": "John", "lastName": "Smith", "age": 45 }, { "firstName": "Jane", "lastName": "Doe", "age": 34 } ]
%dw 2.0 output csv --- payload
firstName,lastName,age John,Smith,45 Jane,Doe,34
Navigate through your data in a structural way by combining DataWeave selectors. Values, keys, attributes, namespaces… no matter how nested, are just a query away.
language: DataWeave content: description: Transform data! resources: - Interactive Tutorial - Playground - VSCode extension - CLI - Community
%dw 2.0 output json --- payload.content.resources[0 to 1]
[ "Interactive Tutorial", "Playground" ]
Leverage data from multiple sources to create a brand new structure of your own. Simply define your structure and combine multiple queries.
<order> <product> <name>MuleSoft Connect</name> </product> <product> <name>Dreamforce</name> </product> <buyer> <name>Michael</name> <city>San Diego</city> <address>Koala Boulevard 314</address> </buyer> </order>
%dw 2.0 output json --- { tickets: payload.order.*product.name, deliverTo: { address: payload.order.buyer.address, city: payload.order.buyer.city } }
{ "tickets": [ "MuleSoft Connect", "Dreamforce" ], "deliverTo": { "address": "Koala Boulevard 314", "city": "San Diego" } }
Combine functions to completely reshape your data. Our standard library covers filtering, mapping, grouping, reducing, and many other common patterns.
[ { "dayOfWeek": "Friday", "event": "Develop mule application" }, { "dayOfWeek": "Sunday", "event": "Breakfast @ Cafe" }, { "dayOfWeek": "Friday", "event": "Football game" } ]
%dw 2.0 output yaml fun highlightTxt(text) = upper(text) ++ "!!" --- payload groupBy ((item) -> item.dayOfWeek) mapObject ((value, key) -> if(key ~= "Friday") (key): value.event map highlightTxt($) else (key): value.event )
%YAML 1.2 --- Friday: - DEVELOP MULE APPLICATION!! - FOOTBALL GAME!! Sunday: - Breakfast @ Cafe
Take a tour of the language and its key characteristics with our interactive tutorial. Learn about our selectors, operators, flow control, and functions while you test your knowledge and get instant feedback.
Go to tutorialLeverage our command-line interface to:
Code away with our Visual Studio Code extension. Design, test, debug, and publish DataWeave scripts with autocompletion, refactors, quick fixes, and live previews.
Install extension