node red push to array
To push an item to an array in Node-RED, you can use the following steps:
- Create an Inject node to trigger the flow.
- Add a Function node to generate the item you want to push to the array.
- Use a Change node to set the msg.topic to the name of the array.
- Connect a Change node to the Function node and set its action to "Change" and its rules to "msg.payload" and "to" the array's name.
- Use a Change node to set the msg.payload to the item you want to push.
- Finally, connect the last Change node to the array you want to push the item to.