I have created a node, and within it there is a for loop:
https://monosnap.com/file/DPbBhDwZe2cnPglIWujIrVTr5s3eJV
Somehow, all the messages in the for loop gets set to the last iteration's message:
https://monosnap.com/file/8IrSuLE44wcNTuivGqFu2ebe621tFo
Should I be calling send() in a different way for multiple messages?
Or maybe I need to create "new objects" so that it doesn't get overwritten. How would I do that.
Thank you in advance.
Bobo
2 February 2021 03:35
2
Have you read Cloning messages in a flow : Node-RED
I would guess this may be related to what you are seeing.
JGKK
2 February 2021 05:39
3
Unfortunately I cant look at the code you posted as i get an access denied.
Yes, adding RED.util.cloneMessage() did the trick.
Thank you!
Colin
2 February 2021 08:20
5
For future reference please see this post for how to share code or a flow here - How to share code or flow json
system
Closed
16 February 2021 08:21
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.