TransformJSON
TransformJSON allows parsing JSON and generating JSON using Javascript.
Source, Space, and Table defines an input table for the transformation script. The table format defined to the right of the Table name, determines how the input table is used:
- If the table format is set to table, TransformJSON iterates over the input table and execute the Script for each record. If Batching is enabled, the Script will be executed for each batch of records instead of each individual record. You can specify the batch size in the Batch size field, which is 1000 by default. You can refer to the current input record from the script as
$il.dataif the batching is not enabled. If the batching is enabled,$il.datarefers to an array of the batch records. - If the table format is set to JSON, the source must be of the JSONInMemorySource type.
$il.datarefers to the input JSON value. - If the table format is set to file, the source table will be opened as file and read into a string in main memory.
$il.datawill refer to the string. Because the whole content of the file is read into the main memory it should be used only for small files.
The Script can also access application and executionContext variables via $il.variables.
Target source, Target space, Target table defines the result table to be created. Script is a Javascript code that performs the transformation. The configuration of the Target section, including the Script, mirrors that of the Target section in the HTTPRequest operation. Refer to the HTTPRequest operation for details.
Last updated on