Columns to JSON

The columns values are transformed to JSON objects for each row. When there are conflicting keys, the result is undefined, might vary between different versions of KNIME.

An example transformation:
From table:

MainNumtext
main12Hello
main21World

with custom key/values: const and val, Main as data bound key, Num with manual num key and text as automatic:

{"main1":{"text": "Hello", "num": 2, "const":"val"}}
{"main2":{"text": "World", "num": 1, "const":"val"}}

Options

New column name
Name of the new JSON column
Unnamed root element
Generated JSON value will be returned without further wrapping
Custom key
Constant key for the main object
Data bound key
For each row this column provides the key for the main object
Manual selection
The predefined key and the actual value in the selected columns will provide the keys and values in the object defined by this setting and the row
Automatic selection
The keys are the column names and the actual value in the selected columns will provide the keys and values in the object defined by this setting and the row
Custom key/value pairs
Additional key/value pairs within the object
Remove source columns
The source columns include the Data bound key column too (when that is selected).

Input Ports

Icon
Table with values.

Output Ports

Icon
Table with the row-wise generated JSON column.

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.