BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
27 / 278 · Module 3 — DataWeave 2.0 Crash Course · filtered: code← prev⊞ allnext →

3.3Salesforce field mapping

External input:

{
  "customerId": "CUST-10042",
  "companyName": "Acme Corporation",
  "phone": "305-555-1234"
}

Salesforce needs:

%dw 2.0
output application/java
---
[
    {
        External_Customer_ID__c: payload.customerId,
        Name: payload.companyName,
        Phone: payload.phone
    }
]

Notice again:

External system field       Salesforce field

customerId              →   External_Customer_ID__c
companyName             →   Name
phone                   →   Phone

This is probably 50% of the DataWeave you'll encounter in straightforward integrations.