5.36Building a lookup map in DataWeave
Suppose Salesforce returns:
[
{
"Id": "001A",
"External_Customer_ID__c": "C001"
},
{
"Id": "001B",
"External_Customer_ID__c": "C002"
}
]
Conceptually you want:
{
"C001": "001A",
"C002": "001B"
}
Then you can efficiently associate source records with Salesforce IDs.
This is where DataWeave tools such as:
map
mapObject
groupBy
become relevant.
You don't need to memorize the exact one-liner yet; understand the optimization strategy.