Examples
Five practical examples demonstrating Data Mapping in real integration scenarios.
Example 1 — Normalize an External API Response
An e-commerce API returns product data with inconsistently cased field names and string-typed prices. Map them to a clean internal schema.
{
"node_type": "DataMapping",
"name": "NormaliseProduct",
"config": {
"source_output": "FetchProductAPI",
"mappings": [
{ "source_field": "ProductName", "target_field": "name", "transform": "trim" },
{ "source_field": "ProductSKU", "target_field": "sku", "transform": "uppercase" },
{ "source_field": "UnitPrice", "target_field": "price", "transform": "toFloat" },
{ "source_field": "StockQty", "target_field": "stock", "transform": "toInt", "default_value": 0 },
{ "source_field": "IsActive", "target_field": "active", "transform": "toBoolean" }
]
}
}
Outcome:
mapped_data contains { name, sku, price, stock, active } with correct types, ready for database insertion.Example 2 — Map CRM Fields to Invoice Schema
Pull a contact from the CRM and map it to the structure expected by the invoice generation node.
{
"node_type": "DataMapping",
"name": "MapInvoiceRecipient",
"config": {
"source_output": "GetCRMContact",
"mappings": [
{ "source_field": "contact.firstName", "target_field": "billToFirstName" },
{ "source_field": "contact.lastName", "target_field": "billToLastName" },
{ "source_field": "contact.emailAddress", "target_field": "billToEmail", "transform": "lowercase" },
{ "source_field": "contact.billingAddress.line1", "target_field": "addressLine1", "default_value": "N/A" },
{ "source_field": "contact.billingAddress.city", "target_field": "city", "default_value": "N/A" },
{ "source_field": "contact.billingAddress.postCode","target_field": "postCode", "default_value": "" }
]
}
}
Outcome: A clean billing address object ready to be passed to the PDF invoice generator node.
Example 3 — Legacy Date Format Conversion
An older system exports dates as MM/DD/YYYY strings. Convert them to ISO 8601 for storage and downstream processing.
{
"node_type": "DataMapping",
"name": "ConvertDates",
"config": {
"source_output": "ParseLegacyRecord",
"mappings": [
{
"source_field": "contractStartDate",
"target_field": "startDateISO",
"transform": "toDate"
},
{
"source_field": "contractStartDate",
"target_field": "startDateDisplay",
"transform": "dateFormat",
"transform_params": { "format": "dd MMMM yyyy" }
}
]
}
}
Outcome: Both a machine-readable ISO date and a human-readable display date are produced from the same source field.
Example 4 — Extract Nested Fields from a Deep JSON Response
A payment gateway returns a deeply nested response. Extract the key fields into a flat object for the accounting system.
{
"node_type": "DataMapping",
"name": "FlattenPaymentResponse",
"config": {
"source_output": "ProcessPaymentGateway",
"mappings": [
{ "source_field": "transaction.id", "target_field": "transactionId" },
{ "source_field": "transaction.status", "target_field": "status", "transform": "uppercase" },
{ "source_field": "transaction.amount.value", "target_field": "amountCents", "transform": "toInt" },
{ "source_field": "transaction.amount.currency", "target_field": "currency", "transform": "uppercase" },
{ "source_field": "transaction.card.last4", "target_field": "cardLast4" },
{ "source_field": "transaction.timestamps.authorized","target_field": "authorizedAt", "transform": "toDate" }
]
}
}
Outcome: A flat
mapped_data object with six clean fields, ready for the accounting database insert node.Example 5 — Phone Number Sanitisation with Regex
Users enter phone numbers in various formats. Strip all non-digit characters to produce a standardised E.164-ready digit string.
{
"node_type": "DataMapping",
"name": "SanitisePhoneNumber",
"config": {
"source": "{@ $input.current }",
"mappings": [
{
"source_field": "phoneNumber",
"target_field": "phoneDigits",
"transform": "regexReplace",
"transform_params": {
"pattern": "[^0-9]",
"replacement": ""
},
"default_value": ""
}
]
}
}
Outcome: Input
"(512) 555-1234" becomes "5125551234". Input "+1-800-FLOWERS" becomes "1800" (letters are stripped). Empty input produces "" due to default_value.