Advanced 20 min read

Transforming Data Between Salesforce and External Systems

By the end of this lesson, you'll be able to:

  • Design a DataWeave transformation for a realistic Salesforce integration scenario
  • Explain where a transformation step typically sits in a flow relative to a connector

Prerequisites: DataWeave Basics

Where transforms fit in a flow

A typical pattern is source → connector (fetch from System A) → transform (reshape) → connector (send to System B) — the transform is the translation layer between two systems that were never designed to speak the same shape natively.

A realistic Salesforce-to-external example

Querying Salesforce Opportunities (with fields like Amount, StageName, CloseDate) and transforming them into the field names and format an external finance system's API expects, before sending them onward with an HTTP request connector.

Mapping a list of Opportunities to a finance system's shape

%dw 2.0
output application/json
---
payload map (opp) -> {
    dealValue: opp.Amount,
    status: opp.StageName,
    expectedCloseDate: opp.CloseDate as Date
}

The map operator applies this transformation to every Opportunity in the incoming list, renaming Salesforce's field names into what the receiving finance system expects.

Exercise

Write a DataWeave script that maps a list of Salesforce Contacts (payload, with FirstName/LastName/Email fields) into a list of objects with keys 'name' (FirstName + ' ' + LastName) and 'contactEmail'.

Show hint

Use payload map (contact) -> { ... } to transform each item in the list.

JAVASCRIPT

Transforming Data Between Salesforce and External Systems — Quick Check

1. Where does a transform step typically sit relative to two connectors in an integration flow?

2. DataWeave's map operator applies a transformation to every item in an incoming list.

3. Why is a transform step usually needed between two different systems' connectors?

Log in to submit the quiz and save your score.

My Notes

Log in to keep private notes on this lesson.

Questions about this lesson

No questions yet — be the first to ask.

Log in to ask a question about this lesson.

Summary

In a real integration flow, a DataWeave transform typically sits right after fetching data from one system and right before sending it to another — reshaping Salesforce's field names and structure into whatever the receiving system expects, or vice versa.