2022.1

Table Of Contents
1. Add a change node to the flow.
2. Create a rule to 'Move' msg.payload.resources to msg.payload.
Iterating over items in an array
If items in an array need to be passed on individually, the flow will need to iterate over the
items. This kind of loop is handled by Node-RED's split node. The split node turns a single
msg.payload, consisting of an array, into a series of messages, each of which has a payload
containing one of the array's elements.
Note that the split node only works on msg.payload and not on its child objects.
Example
A startup flow needs to iterate over the array in msg.payload that contains the names of OL
Connect resources.
1. Insert a split node into the flow.
2. Add a debug node to verify that Node-RED creates a new message for each resource
name.
Concatenating strings
To concatenate two strings in different variables, one could use a function node and script it, or
use a change node.
Example
A startup flow needs to upload an OL Connect resource to the OL Connect server, but the
resource name in msg.payload lacks the path. The path is stored in msg.resourceFolder. To
construct the full path and pass it via msg.fileName, the flow can use a change node.
1. Add a change node and a file upload node.
2. Double-click the change node and create a rule to 'Set' msg.fileName to
msg.resourceFolder & payload. The latter is a JSONata expression.
Page 208