Portal Community

Example 1 — Basic Rename and Type Conversion (from an HTTP Request node)

An upstream HTTP Request node calls a third-party product API. Rename its inconsistently-cased, string-typed fields to a clean internal schema with correct types.

Upstream input (HTTP Request node's output)
{
  "timestamp": "2026-07-24T09:00:11.4021003Z",
  "triggerTime": "2026-07-24T09:00:10.0000000Z",
  "resource": "http-request",
  "operation": "GET",
  "status": "success",
  "portName": "main",
  "items": [
    {
      "json": {
        "ProductName": "  Wireless Mouse  ",
        "ProductSKU":  "wm-2200",
        "UnitPrice":   "24.99",
        "StockQty":    "138",
        "IsActive":    "true"
      }
    }
  ],
  "success": true
}
DataMapping configuration
{
  "dataMappings": [
    { "sourceField": "ProductName", "targetField": "name",   "transform": "trim" },
    { "sourceField": "ProductSKU",  "targetField": "sku",    "transform": "uppercase" },
    { "sourceField": "UnitPrice",   "targetField": "price",  "transform": "todecimal" },
    { "sourceField": "StockQty",    "targetField": "stock",  "transform": "toint" },
    { "sourceField": "IsActive",    "targetField": "active", "transform": "toboolean" }
  ]
}
Output
{
  "status": "success",
  "mappingFieldCount": 5,
  "recordCount": 1,
  "items": [
    {
      "json": { "name": "Wireless Mouse", "sku": "WM-2200", "price": 24.99, "stock": 138, "active": true }
    }
  ]
}
Outcome: Every value went from a loosely-typed API string to the correctly-typed internal field — no code required.

Example 2 — Combining Two Fields with "expression" (from a database query node)

A database-query node returns customer rows with separate firstName/lastName columns. No single named transform can combine two source fields — use "expression" with transformExpression instead.

Upstream input (SQL query node's output)
{
  "timestamp": "2026-07-24T09:05:44.7710021Z",
  "triggerTime": "2026-07-24T09:05:44.0000000Z",
  "resource": "sql-query",
  "operation": "select",
  "status": "success",
  "portName": "main",
  "items": [
    {
      "json": {
        "firstName": "Priya",
        "lastName": "Nair",
        "email": "[email protected]",
        "signupDate": "2026-01-08T00:00:00Z"
      }
    }
  ],
  "success": true
}
DataMapping configuration
{
  "dataMappings": [
    {
      "sourceField": "firstName",
      "targetField": "fullName",
      "transform": "expression",
      "transformExpression": "item.firstName + ' ' + item.lastName"
    },
    { "sourceField": "email",      "targetField": "email",     "transform": "lowercase" },
    { "sourceField": "signupDate", "targetField": "memberSince", "transform": "todate" }
  ]
}
Output
{
  "status": "success",
  "mappingFieldCount": 3,
  "recordCount": 1,
  "items": [
    {
      "json": {
        "fullName": "Priya Nair",
        "email": "[email protected]",
        "memberSince": "2026-01-08T00:00:00Z"
      }
    }
  ]
}
Outcome: fullName was built by reading item.firstName and item.lastName — two different fields — from a single rule whose own sourceField (firstName) only supplies the value variable, unused here. The expression reads the whole record via item instead.

Example 3 — Deeply Nested Extraction with a Built-In Transform (from a payment gateway webhook)

A payment gateway's webhook payload is deeply nested. Extract the key fields into a flat record for the accounting system.

Upstream input (webhook trigger's output)
{
  "timestamp": "2026-07-24T09:11:02.0091124Z",
  "triggerTime": "2026-07-24T09:11:02.0000000Z",
  "resource": "webhook-trigger",
  "operation": "payment.captured",
  "status": "success",
  "portName": "main",
  "items": [
    {
      "json": {
        "transaction": {
          "id": "TXN-88213",
          "status": "captured",
          "amount": { "value": "48250", "currency": "usd" },
          "card": { "last4": "4242" },
          "timestamps": { "authorized": "2026-07-20T14:03:11Z" }
        }
      }
    }
  ],
  "success": true
}
DataMapping configuration
{
  "dataMappings": [
    { "sourceField": "transaction.id",                    "targetField": "transactionId" },
    { "sourceField": "transaction.status",                "targetField": "status",       "transform": "uppercase" },
    { "sourceField": "transaction.amount.value",           "targetField": "amountCents",  "transform": "toint" },
    { "sourceField": "transaction.amount.currency",        "targetField": "currency",     "transform": "uppercase" },
    { "sourceField": "transaction.card.last4",             "targetField": "cardLast4" },
    { "sourceField": "transaction.timestamps.authorized",  "targetField": "authorizedAt", "transform": "todatetime" }
  ]
}
Output
{
  "status": "success",
  "mappingFieldCount": 6,
  "recordCount": 1,
  "items": [
    {
      "json": {
        "transactionId": "TXN-88213",
        "status": "CAPTURED",
        "amountCents": 48250,
        "currency": "USD",
        "cardLast4": "4242",
        "authorizedAt": "2026-07-20T14:03:11Z"
      }
    }
  ]
}
Outcome: A flat six-field record reached three and four levels deep into the source with pure dot-notation — no code required.

Example 4 — Passthrough Mode / Data Assigner (from an upstream mapping step)

A branch of the workflow only needs to move data through to the next node, with no field mapping at all. Rather than writing identity rules for every field, use passthrough mode — or drop in the pre-built Data Assigner node, which is this same node type pre-configured for exactly this.

Upstream input
{
  "timestamp": "2026-07-24T09:20:00.0000000Z",
  "triggerTime": "2026-07-24T09:20:00.0000000Z",
  "resource": "data-mapping",
  "operation": "data-mapping",
  "status": "success",
  "portName": "main",
  "items": [
    { "json": { "orderId": "ORD-7741", "total": 129.50, "lines": [{ "sku": "A1" }, { "sku": "B2" }] } }
  ],
  "success": true
}
DataMapping configuration (or the Data Assigner node, Template 10000108)
{
  "dataMappingMode": "passthrough",
  "dataMappings": []
}
Output
{
  "status": "success",
  "mappingFieldCount": 0,
  "recordCount": 1,
  "items": [
    { "json": { "orderId": "ORD-7741", "total": 129.50, "lines": [{ "sku": "A1" }, { "sku": "B2" }] } }
  ]
}
Outcome: Each item's json is the resolved source record unchanged. mappingFieldCount is 0 (it reflects the rule count, not the passthrough record's field count). No validation error occurs despite dataMappings being empty, because dataMappingMode is "passthrough".

Example 5 — inlineDataSource: Manually-Entered Test Data (no upstream node at all)

While building a workflow, test a mapping without wiring up a real upstream node. Type plain JSON directly into inlineDataSource — it does not need the items/json envelope; DataMapping normalizes it into that shape automatically.

inlineDataSource (exactly what you type — plain JSON, no envelope)
{
  "firstName": "Alex",
  "phone": "(512) 555-1234",
  "invoiceNumber": "INV-2026-004471",
  "middleName": ""
}
DataMapping configuration
{
  "inlineDataSource": "{\"firstName\":\"Alex\",\"phone\":\"(512) 555-1234\",\"invoiceNumber\":\"INV-2026-004471\",\"middleName\":\"\"}",
  "dataMappings": [
    { "sourceField": "firstName",      "targetField": "displayHandle",  "transform": "concat:_user" },
    { "sourceField": "phone",          "targetField": "phoneDigits",    "transform": "regexreplace:[^0-9]:" },
    { "sourceField": "invoiceNumber",  "targetField": "invoiceSuffix",  "transform": "substring:-4" },
    { "sourceField": "invoiceNumber",  "targetField": "invoicePrefix",  "transform": "substring:0:7" },
    { "sourceField": "middleName",     "targetField": "middleName",     "transform": "defaultvalue:N/A" }
  ]
}
Output (normalized into the standard envelope automatically)
{
  "status": "success",
  "mappingFieldCount": 5,
  "recordCount": 1,
  "items": [
    {
      "json": {
        "displayHandle": "Alex_user",
        "phoneDigits": "5125551234",
        "invoiceSuffix": "4471",
        "invoicePrefix": "INV-202",
        "middleName": "N/A"
      }
    }
  ]
}
Outcome: displayHandle: "Alex_user", phoneDigits: "5125551234", invoiceSuffix: "4471" (last 4 chars via negative substring start), invoicePrefix: "INV-202" (first 7 chars), middleName: "N/A" (empty string triggered the defaultvalue: fallback). What you typed as inline test data was plain JSON — the node built the envelope, not you.

Example 6 — Multiple Upstream Records: One Mapped Item Per Input Record (from a bulk query node)

DataMapping isn't limited to one record. When the upstream node's items holds many entries — here, a bulk employee-lookup query — every entry is mapped independently and the output holds the same number of items.

Upstream input (database query node's output, 3 rows)
{
  "timestamp": "2026-07-24T09:30:18.5512200Z",
  "triggerTime": "2026-07-24T09:30:18.0000000Z",
  "resource": "sql-query",
  "operation": "select",
  "status": "success",
  "portName": "main",
  "items": [
    { "json": { "EmpName": "  Dana Kim  ",   "EmpEmail": "[email protected]",   "EmpSalary": "82000" } },
    { "json": { "EmpName": "  Tomas Reyes  ", "EmpEmail": "[email protected]", "EmpSalary": "76500" } },
    { "json": { "EmpName": "  Sofia Lin  ",   "EmpEmail": "[email protected]",   "EmpSalary": "91250" } }
  ],
  "success": true
}
DataMapping configuration
{
  "dataMappings": [
    { "sourceField": "EmpName",   "targetField": "name",   "transform": "trim" },
    { "sourceField": "EmpEmail",  "targetField": "email",  "transform": "lowercase" },
    { "sourceField": "EmpSalary", "targetField": "salary", "transform": "todecimal" }
  ]
}
Output — recordCount: 3, one item per input record
{
  "status": "success",
  "mappingFieldCount": 3,
  "recordCount": 3,
  "items": [
    { "json": { "name": "Dana Kim",   "email": "[email protected]",   "salary": 82000 } },
    { "json": { "name": "Tomas Reyes","email": "[email protected]","salary": 76500 } },
    { "json": { "name": "Sofia Lin",  "email": "[email protected]",  "salary": 91250 } }
  ]
}
Outcome: No Loop node needed just to reshape rows — DataMapping applied the same three rules to all three upstream records and produced three independent output items.

Example 7 — Array Indexing, JSON Encode/Decode, and Base64 (from an inventory API)

Combines array indexing into nested lists with the JSON/Base64 transforms, sourced from a single upstream record with richer nested structure.

Upstream input (HTTP Request node's output)
{
  "timestamp": "2026-07-24T09:40:55.0091003Z",
  "triggerTime": "2026-07-24T09:40:54.0000000Z",
  "resource": "http-request",
  "operation": "GET",
  "status": "success",
  "portName": "main",
  "items": [
    {
      "json": {
        "items": [
          { "sku": "A1", "price": "12.50" },
          { "sku": "B2", "price": "8.00" }
        ],
        "data": {
          "users": [
            { "email": "[email protected]" },
            { "email": "[email protected]" },
            { "email": "[email protected]" }
          ]
        },
        "metadata": { "tags": ["vip", "recurring"], "score": 87 },
        "apiKey": "sk-live-9f2c",
        "encodedNote": "aGVsbG8gd29ybGQ="
      }
    }
  ],
  "success": true
}
DataMapping configuration
{
  "dataMappings": [
    { "sourceField": "items[0].sku",         "targetField": "firstItemSku" },
    { "sourceField": "items[0].price",       "targetField": "firstItemPrice", "transform": "todecimal" },
    { "sourceField": "items[1].sku",         "targetField": "secondItemSku" },
    { "sourceField": "data.users[2].email",  "targetField": "thirdUserEmail", "transform": "lowercase" },
    { "sourceField": "metadata",             "targetField": "metadataJson",  "transform": "jsonstringify" },
    { "sourceField": "apiKey",               "targetField": "apiKeyB64",     "transform": "base64encode" },
    { "sourceField": "encodedNote",          "targetField": "note",          "transform": "base64decode" }
  ]
}
Output
{
  "status": "success",
  "mappingFieldCount": 7,
  "recordCount": 1,
  "items": [
    {
      "json": {
        "firstItemSku": "A1",
        "firstItemPrice": 12.5,
        "secondItemSku": "B2",
        "thirdUserEmail": "[email protected]",
        "metadataJson": "{\"tags\":[\"vip\",\"recurring\"],\"score\":87}",
        "apiKeyB64": "c2stbGl2ZS05ZjJj",
        "note": "hello world"
      }
    }
  ]
}
Outcome: Array indexing (items[0], data.users[2]) combines with JSON/Base64 transforms in one mapping pass. An out-of-range index (e.g. items[5]) would resolve to null rather than raising an error. If encodedNote were not valid Base64, base64decode would return it unchanged rather than erroring.