Modify values from grouped rows
Use the Modify values from grouped rows step to build complex hierarchical data and group data based on a hierarchical data field by using path definitions on an ordered group of input rows.
This step modifies hierarchical data to form nested JSON key-value pairs. It can also build complex data by nesting arrays, objects, and key-value pairs. The step takes non-hierarchical data and converts it to hierarchical data and sends it to other steps.
For more information, see Hierarchical data.
Step name
Step name: Specify the unique name of the Modify values from grouped rows step on the canvas. You can customize the name or leave it as the default.
Grouping fields

Field name
Specify the field name to group the incoming data.
Pass through?
Select to add the specified incoming field to the output fields.
In Target hierarchical, specify a new field name to add to the output, or select an incoming hierarchical field name to modify.
If the target field is an existing field, it must be included as one of the grouping fields.
Modifications
Hierarchical path: Specify the path to modify or create inside the target hierarchical field. See Hierarchical data path specifications.
Action: The action to perform on the target field.
SET: Set the target hierarchical path to the value specified in Value field name.
SET_IGNORE_NULL_VALUE: Perform SET only if the value field is not null.
SET_IF_NULL: Set the target hierarchical path to the value specified in Value field name if the target path is null.
UNSET: Unset the target hierarchical path.
Example:
before: { hello: null, hello2: 10 }, after: {}
UNSET_IF_NULL: Unset the target hierarchical path if the value stored at the path is null.
Example:
before: { hello: null, hello2: 10 }, after: { hello2: 10 }
Value field name: Specify the field to use for the action.
Example
The sample transformation Modify_From_Grouped_Rows.ktr demonstrates the capabilities of this step and is available in the plugin distribution package in the data-integration/plugins/hierarchical-datatype-plugin/samples/transformations directory.
This step is also demonstrated in Advanced_Using_Multiples_To Join_And_Edit.ktr. Comments in the transformation explain how the steps are used.

Last updated
Was this helpful?

