Modify Field


The Modify Field node modifies the input msg according to the selected action and passes it to the downstream node as output msg.

Node Type

Transformation.

Input and Output Ability

This node has 1 entry point and 1 exit point. Both the input and output are JSON.

Node Properties

../../../_images/modify_field.png


Name

The name for this node.


Action

The modify action. After selecting the action, click + Add Field to enter the details for modification.

  • Change: Changes the value of existing fields in the input msg.

    • Enter the key and the value to change to.

  • Append: Appends new fields to the input msg.

    • Enter the key and the value to append.

  • Remove: Remove fields from the input msg.

    • Enter the key to remove.


Description

The description for this node.

Limitations

  • Modifies only the input msg and not the metadata.

  • Modifies only the first level of the msg, i.e. if there are arrays, the values inside the arrays cannot be modified.

Samples

Input Sample

{
  "color": "blue",
  "num": 8,
  "temperature": 22.4,
  "windSpeed": 50
}

Output Sample

Change

  • Key: color

  • Value: yellow

{
  "color": "yellow",
  "num": 8,
  "temperature": 22.4,
  "windSpeed": 50
}

Append

  • Key: shape

  • Value: circle

{
  "color": "blue",
  "num": 8,
  "temperature": 22.4,
  "windSpeed": 50,
  "shape": "circle"
}

Remove

  • Key: num

{
  "color": "blue",
  "temperature": 22.4,
  "windSpeed": 50
}