DEV Community

Cover image for Data Translate In OIC
Naveen
Naveen

Posted on

Data Translate In OIC

Native JSON ↔ Stringified JSON: OIC's Data Translate Action

we recently tried a project with the Data Translate action & it addresses a surprisingly common integration requirement: converting a native JSON payload into flat, stringified JSON & converting that string back into a native JSON payload.

What exactly is stringified JSON?

But sometimes an API, JavaScript function, downstream application or another processing step needs that JSON represented as a single text string rather than as a JSON object or array.

Oracle describes this as flat, stringified JSON.

What We Tried in OIC

  1. The Below reference of Write as a Stringified JSON

Let's see the above flow in detailed how I Tested !!

Native Json mapped to Data Translate
Request Payload:

{ "invoiceNo" : "INV-2026-001", "date" : "2026-09-26", "customer" : { "id" : 2051, "name" : "Oman Trading LLC" }, "lines" : [ { "sku" : "STP-250", "description" : "Packaged STP 250 m3/day", "qty" : 2, "unitPrice" : 12500 }, { "sku" : "SP-01", "description" : "Spare filter bag", "qty" : 1, "unitPrice" : 3400 } ], "currency" : "OMR", "total" : 28400 }
Enter fullscreen mode Exit fullscreen mode

dummy.json

{
  "invoiceNo": "INV-2026-001",
  "date": "2026-09-26",
  "customer": {
    "id": 2051,
    "name": "Oman Trading LLC"
  },
  "lines": [
    {
      "sku": "STP-250",
      "description": "Packaged STP 250 m3/day",
      "qty": 2,
      "unitPrice": 12500
    },
    {
      "sku": "SP-01",
      "description": "Spare filter bag",
      "qty": 1,
      "unitPrice": 3400
    }
  ],
  "currency": "OMR",
  "total": 28400
}
Enter fullscreen mode Exit fullscreen mode

I taken Postman Echo connection

Request Payload:

{ "apiKey" : "abc-123", "meta" : { "requestId" : "REQ-9001", "system" : "STP-erp", "timestamp" : "2026-09-26T10:15:00+04:00" }, "payload" : "{\"invoiceNo\":\"INV-2026-001\",\"date\":\"2026-09-26\",\"customer\":{\"id\":2051,\"name\":\"Oman Trading LLC\"},\"lines\":[{\"sku\":\"STP-250\",\"description\":\"Packaged STP 250 m3/day\",\"qty\":2,\"unitPrice\":12500.0},{\"sku\":\"SP-01\",\"description\":\"Spare filter bag\",\"qty\":1,\"unitPrice\":3400.0}],\"currency\":\"OMR\",\"total\":28400.0}" }
Enter fullscreen mode Exit fullscreen mode

Response Payload:

{ "status" : "OK", "receivedAt" : "2026-09-26T10:15:02+04:00", "result" : "{\"invoiceNo\":\"INV-2026-001\",\"date\":\"2026-09-26\",\"customer\":{\"id\":2051,\"name\":\"Oman Trading LLC\"},\"lines\":[{\"sku\":\"STP-250\",\"description\":\"Packaged STP 250 m3/day\",\"qty\":2,\"unitPrice\":12500.0},{\"sku\":\"SP-01\",\"description\":\"Spare filter bag\",\"qty\":1,\"unitPrice\":3400.0}],\"currency\":\"OMR\",\"total\":28400.0}" }
Enter fullscreen mode Exit fullscreen mode

Final response we captured to Node 1 -using copy of XSLT

Result of Write as a Stringified JSON


2.The Below reference of Read as Stringified JSON

Let's Gooooooooooooooooooo !!
  1. Quickly create new version of Integration
  2. Úpdate the node 1 Response payload with below sample
{ "invoiceNo" : "INV-2026-001", "date" : "2026-09-26", "customer" : { "id" : 2051, "name" : "Oman Trading LLC" }, "lines" : [ { "sku" : "STP-250", "description" : "Packaged STP 250 m3/day", "qty" : 2, "unitPrice" : 12500 } ], "currency" : "OMR", "total" : 28400 }
Enter fullscreen mode Exit fullscreen mode

3.Add the Data translate again with operation Read as Stringified JSON

ttt.json

{
  "invoiceNo": "INV-2026-001",
  "date": "2026-09-26",
  "customer": {
    "id": 2051,
    "name": "Oman Trading LLC"
  },
  "lines": [
    {
      "sku": "STP-250",
      "description": "Packaged STP 250 m3/day",
      "qty": 2,
      "unitPrice": 12500
    }
  ],
  "currency": "OMR",
  "total": 28400
}
Enter fullscreen mode Exit fullscreen mode

Map the data from write Translate to Read Translate

Finally Map the result of Read as Stringified JSON to Node 1 Response

Tested Result:


User Benefits:

  • Fewer integration steps by avoiding extra Stage File actions.
  • Less custom JavaScript for JSON stringification.
  • No Base64 handling for this conversion scenario.
  • Easy two-way conversion: Native JSON ↔ Stringified JSON.
  • Supports complex JSON, including nested objects and arrays.

Top comments (0)