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.
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
-
Click on the icon on the left editing menu.
-
Select JSON Transformation v2 to add it to the canvas. You can use the search bar 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). -
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 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 .
Configure the Form
-
Select JSON Transformation v2 on the canvas.
-
Click the editing icon.
-
Fill in the field Name with a unique name for the step. By default, you will see it as "JSON Transformation v2".
-
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. -
Click SAVE.
Example
See an example of an integration flow with JSON Transformation v2 in the GIF:
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], ' ')
}
-
REST trigger, whose request payload contains the field
first name
. -
Environment variable
middleName
. -
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
.
Share your suggestions with us!
Click here and then [+ Submit idea]