Message sends old object

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.

Have you read Cloning messages in a flow : Node-RED

I would guess this may be related to what you are seeing.

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! :grin:

For future reference please see this post for how to share code or a flow here - How to share code or flow json

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.