The Change node in Node-RED is a fundamental node that enables you to alter or modify the attributes of an incoming message. It grants you the ability to manipulate the payload, topic, and other message properties according to your specific needs.
The Change node offers various operations that can be applied to message properties, such as assigning new values, removing properties, transferring values from one property to another, and more. Here are some notable features and use cases of the Change node:
Payload modification: You have the option to change the payload value of the message by assigning it a new value. This proves useful when you aim to substitute or update the content of the payload.
Manipulating message properties: The Change node permits the modification of properties other than the payload. For instance, you can alter the topic, timestamp, or any custom properties associated with the message.
Copy values: It is possible to duplicate the value of one message property to another property. This functionality is valuable when you desire to replicate or transfer data between different properties.
Delete properties: The Change node empowers you to eliminate unwanted properties from the message. This aids in reducing the message size or removing unnecessary data prior to further processing.
JSONata expressions: The Change node supports the utilization of JSONata expressions, which are potent query and transformation syntaxes for handling JSON data. JSONata expressions can be utilized to extract values from the message payload or perform intricate transformations.
Multiple operations: The Change node allows you to apply multiple operations to a single message. You can configure numerous rules within the node to execute different transformations based on your requirements.
All in all, the Change node in Node-RED delivers flexibility in manipulating and transforming the properties of a message. It empowers you to modify the payload, topic, and other attributes of an incoming message, thereby making it an influential tool for data transformation and preparation within your flows.
Reviews
There are no reviews yet.