BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
240 / 278 · Module 17 — Interview System-Design Scenarios · filtered: code← prev⊞ allnext →

17.10Design

HTTP Listener
 ↓
Validate
 ↓
save original request
 ↓
transform Account
 ↓
Upsert Account
 ↓
store accountId
 ↓
transform Contacts
 ↓
Upsert Contacts
 ↓
response

Contact transformation:

%dw 2.0
output application/java
---
vars.originalCustomer.contacts map (contact) -> {
    External_Contact_ID__c: contact.contactId,
    FirstName: contact.firstName,
    LastName: contact.lastName,
    AccountId: vars.accountId
}