Object Handling
Last updated
Last updated
There are two object manipulations that can be used in the platform that are particularly important for creating a flow:
With Skyone Studio you can manipulate data in JSONata code, coming from several preceding modules or from different flow parameters. For that, you need to use the "Data Transformation" module, which is a default module in the platform.
To get started, in the editing and configuration window of the module in your flow, follow these steps:
Go to the "Source Data" tab;
Drag the variables from your flow into the "Value" column;
Choose the "Type of variable" (text, number, etc);
Give a name to the "Key".
You can also configure the variables you want using a JSON object in the "Source JSON" tab.
When using "Data Source", note that the visualization can be done by clicking on the arrow located on the right side of the variable.
When you click "Next" on the "Data Transformation" module configuration screen, these variables should be accessed in the JSONata code as shown below:
JSON example:
After writing the JSONata, click on "Execute". To finish the configuration, click "Save".
You can manipulate variables by clicking directly on the component parameters. This makes it easier to access and manipulate sub-objects or objects within the result parameters of the previous components, making the process more intuitive and straightforward.
To manipulate the variables, follow these steps:
Click on the arrow to the right of the variable in the "value" column.
In the Path field, note that there is a JSON base associated with it which you can change using brackets [ ]. Manipulate as necessary.
We often want to reference only one property within an object. To do that, we must specify it within the flow, even if that internal variable is not explicit, even if that internal variable is not explicit, so that we can use only what we need.
In the following example, the Data Transformation module, which precedes the module we are configuring in our flow, generates an object called data, whose content is as follows:
We can reference the internal variables of this object in another step of the flow. Using date as an example, you'll need to enter the path of the variable. You can perform the same operation using a SMOP, which allows you not only to reference, but also to perform operations with an object's internal parameters.
In the next example below, we use the date parameter from the Data Transformation module in param1 of a SMOP and, to create the expression, we reference the offset parameter, a flow parameter whose current value is "0":