JSON Transformer
Discover more about the JSON Transformer component and how to use it on the Digibee Integration Platform.
Last updated
Discover more about the JSON Transformer component and how to use it on the Digibee Integration Platform.
Last updated
JSON Transformer allows transformations in the JSON being processed in your pipeline. With a configuration form you can perform a variety of actions.
Take a look at the configuration options for the component. Parameters supported by Double Braces expressions are marked with (DB)
.
Parameter | Description | Default value | Data type |
---|---|---|---|
When using Double Braces, the values of the properties to be changed must be accessed with the use of the word "item". With the word "item" it's possible to obtain values of all properties in the same JSON level that's being accessed.
Examples:
Rename Property: Renames the JSON key to a new key, which can consist of a static or dynamic value composed by Double Braces.
Edit Property: Allows the transformation of the values in a property through Double Braces.
Remove Property: Removes properties in any structure of JSON.
Remove Property with Condition: With the logical operators of the functions, you can define a condition so that "true" is returned if the property must be removed.
This component doesn't expect any specific input message, only if an expression in Double Braces is informed in some of its fields.
Because it's a component that transforms the input JSON, the output is the result of the configurations defined by you.
If no property defined in the component configurations is found in JSON, the result will be the same one of the input JSON.
To better understand the messages flow in the Platform, refer to Messages processing.
See below how the component behaves in certain situations and what its respective configurations are.
The properties can be renamed through static or dynamic values composed by Double Braces. These properties can be in an object, array or in the root.
In this example, see how to rename "a" to "id" and "b" to "name". The component configurations must be:
The values can be transformed by applying Double Braces and functions from the Digibee Integration Platform. This property can be in an object, array or in the root.
It's possible to apply functions such as FORMATDATE, CONCAT, REPLACE, FORMATNUMBER, among others.
To better understand how these resources work, read the article Double Braces Functions.
In this example, see how to transform the "id" from number to string. The component configurations must be:
The properties can be removed by using the logical operators of the Double Braces functions. It's possible to define a condition that, when resolved to "true", will indicate that the property must be removed. These properties can be in an object, array or in the root.
In this example, see how to remove "description" with a null value. The component configurations must be:
The properties can be removed just by declaring their names in the Properties to be removed field. These properties can be in an object, array or in the root.
Some of the parameters above accept Double Braces. To better understand how this language works, read the article How to reference data using Double Braces.