IconJSON Transformer0 ×

StreamableJSON related functionality for KNIME version 3.6.0.v201807061527 by KNIME AG, Zurich, Switzerland

Applies a patch or a merge patch on the input JSON column.

When a (merge) patch cannot be applied, missing values will be generated, node execution will not fail.

See also the node: JSON Diff.

Given {"a":"b","c":{"d":"e","f": "g"} } let us assume the target is {"a":"z","c":{"d":"e"} } (changing a's value to z and removing f). To achieve this, either the following patch should be applied: [{"op":"replace","path":"/a","value":"z"},{"op":"remove","path":"/c/f"}] or this merge and patch: {"a":"z","c":{"f": null} }

The following operators (op) are supported for patch:

  • add (path, value)
  • remove (path)
  • replace (path, value)
  • move (from, path)
  • copy (from, path)
  • test (path, value)

The merge and patch format reconstructs the parts that need to be changed (changes included), all else can be omitted.

It uses the fge/json-patch implementation.

To refer to flow variables, use the $${TflowVarName}$$ syntax (where T is S for String type, D for floating point numbers and I for integer numbers).

To refer to columns (boolean, numeric, String, JSON), use the $columnName$ syntax.

References to (0-based) row index ($$ROWINDEX$$), row count ($$ROWCOUNT$$) and row keys ($$ROWID$$) can also be used in values.

Options

JSON column
The column containing JSON values
Remove source column
When checked, the source column will be removed
New column
Name of the new (JSON) column
Patch type
Either patch or a merge and patch
Keep original value when 'test' operation fails
When there are failing 'test' operations, the original value is kept instead of inserting a missing value (and a warning is issued).
Patch
A JSON of the selected patch type compatible with the JSON values. The patch expression must either be a single JSON Patch expression (object) or an array of JSON Patch expressions.

Input Ports

A table with JSON column to transform

Output Ports

Table with the transformed JSON values

Best Friends (Incoming)

Best Friends (Outgoing)

Update Site

To use this node in KNIME, install JSON related functionality for KNIME from the following update site:

Wait a sec! You want to explore and install nodes even faster? We highly recommend our NodePit for KNIME extension for your KNIME Analytics Platform.