JSON Transformation v2

JSON Transformation v2 is a step that facilitates the manipulation and transformation of JSON data between different systems and applications. It’s an essential feature to ensure data consistency and compatibility across various APIs and data sources.

To transform the JSON, you will use the JSONata language. To assist you, the JSONata Exerciser can be accessed directly from the step form. In it, you can:

  • Define the structure of the input data.

  • Create transformation expressions that generate the output data in the desired format.

  • Check for errors in the expression.

To understand this language in detail, refer to the official JSONata documentation.
Currently, we provide two versions of the JSON Transformation component. In version 2 (v2), there is no option to select input data, since you can use the input and output data from previous steps in JSONata.

Next, learn how to add JSON Transformation v2 to the canvas and configure its form.

Add JSON Transformation v2 to the Canvas

  1. Click on the icon tool icon with plus sign on the left editing menu.

  2. Select JSON Transformation v2 to add it to the canvas. You can use the search bar search steps icon to find it.

    You can add it as many times as you need. In this case, each time you add this tool, a number is added next to its name (JSON Transformation v2 1, JSON Transformation v2 2, JSON Transformation v2 3).
  3. Connect JSON Transformation v2 to the flow steps. This tool can connect to a previous step and a following step.

To copy the step, click the copy icon button. If the step form is already configured, the settings will be copied too.

To remove JSON Transformation v2 from the canvas, select it and click the trash can icon trash can icon.

Configure the Form

  1. Select JSON Transformation v2 on the canvas.

  2. Click the pencil icon editing icon.

  3. Fill in the field Name with a unique name for the step. By default, you will see it as "JSON Transformation v2".

  4. Add the expression on the JSONATA board. If there are any errors in the expression, you will see an error message in red in the bottom right corner of this field.

    You can access the JSONata Exerciser to create it, by clicking on GO TO JSONATA. Then, copy and paste the expression from the JSONata Exerciser on the board.
  5. Click SAVE.

Example

See an example of an integration flow with JSON Transformation v2 in the GIF:

json transformation v2

In the example, we have the following components that will be used in the transformation expression in the JSONATA panel:

{
    "name": $join([Trigger.Request.Payload.firstName, ENV_VARIABLES.middleName,Get_Customer_By_Id.Response.Payload.last_name], ' ')
}
  1. REST trigger, whose request payload contains the field first name.

  2. Environment variable middleName.

  3. Connector Get Customer by Id, whose response payload contains the field last name.

This way, the information from the fields first name, middleName (environment variable), and last name will be combined into a single field: name.

Thanks for your feedback!
EDIT

Share your suggestions with us!
Click here and then [+ Submit idea]