BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
5 / 81 · Module 3 — DataWeave 2.0 Crash Course · filtered: interview← prev⊞ allnext →

3.1The basic structure

A DataWeave script usually looks like:

%dw 2.0
output application/json
---
{
    firstName: payload.firstName,
    lastName: payload.lastName
}

Three pieces:

%dw 2.0
↑ language/version

output application/json
↑ output format

---
↑ separates header from transformation

{ ... }
↑ actual expression

The part after --- is essentially:

“What should the output become?”