Skip to main content

Transforming message between JSON formats using JSLT expression

This scenario applies only to Talend ESB, Talend Data Services Platform, Talend MDM Platform, Talend Real-Time Big Data Platform, and Talend Data Fabric.

This scenario illustrates how to transform message between JSON formats using a template from the Studio repository, the local file system, and specified in the cJSLT component.

A JSON template file demo.jslt in the Studio repository and the local file system with the following content will be used in this scenario:
{
  "firstName": .givenName,
  "lastName": .sureName,
  "fullName": .givenName + " " + .sureName,
  "fileName": split(.path, "/")[-1],
  "unixTime": round(now() * 1000),
  "status": $headers.responseCode,
  * - givenName, sureName : .
}

For more information on how to create a Resource in the Studio, see Creating a Route Resource.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!