Data Transform Module

Definition

The "Data Transform" module, the platform's standard module for use in any flow, was created for data transformation using JSONATA, thus facilitating the creation of complex operations.

JSONata is a lightweight language designed to query and transform JSON data structures.

The "Data Transform" module consists of a single operation that allows the manipulation of multiple data points and the transformation of these data into the desired format. This module always initializes the data parameter, which enables us, as seen in Object Handling, not only to obtain a data set but also to filter so that only a specific subset is invoked.

"Data Transform" is ideal for more complex data manipulations with an internal response within the flow. For less complex data manipulations, we recommend using an SMOP. For more complex data manipulations that require a response to an HTTP request, we recommend using the "Return" module.

Configuration of the Data Transform module

The "Data Transform" module appears in the Tools option when editing a flow. As soon as you click to add it, the modal opens for configuration:

Variable Configuration

In this section, under the "Data Source" tab, you will find the following fields:

  • Key: variable identifier

  • Value: type or drag a variable

  • Type: choose the most appropriate data type. Options are: text, number, boolean, object, and array.

If you prefer, you can fill in the Source JSON

After completing the configurations, click "Next".

Result

On this screen, you can execute and view the data transformation information and manipulate it with JSONata.

To finalize the module configuration, click "Save".


JSONata and extra functions

The Data Transformation module uses extra JSONata functions for advanced string manipulation, encryption, and file handling.

Below are the functions available to optimize your integration flows:

  • md5(value): Generates an MD5 hash in hexadecimal format. Useful for quick integrity checks.

  • sha256(value, digest?): Generates a SHA-256 hash, which is more robust than MD5. The default output is hex.

  • generateHmac(value, secret): Creates a hash-based message authentication code to securely sign data.

  • removeValues(value, callback): Recursively removes keys from an object or array based on a condition.

  • removeKeys(value, targetKey): Cleans unwanted fields in nested structures by removing all occurrences of a specific key.

  • splitPDF(value): Processes a Base64 PDF and separates it into an array, where each item is an individual page.

How to use the functions in practice

To use the functions in your Data Transformation module:

  1. Click Edit in the module to access the editor.

  2. Enter the JSONata expression using the desired extra function, such as md5(source_field).

  3. Click Run to validate the hash generation or structure cleanup.

  4. Check the result in the output panel before saving the configuration.

Last updated

Was this helpful?