Node creating new message, so losing properties

Hey all

I want to use the node-red-contrib-opcua module to read multiple tags at once using the opc ua client node (action: READ MULTIPLE). The problem with this node is that for this action it constructs a new msg instead of using the existing one and changing properties. So I lost properties which I need in the rest of my flow.

I already read online that nodes should typically use the existing message and only add/change properties instead of constructing a new message, but is there anyway to handle this externally of the node?

I thought about saving the message to the context before 'entering' the node, and the reading it back again after. But I think I can have issues when I have multiple messages at the same time coming in.

Kr
Sven

Exactly this. You will need to be aware of this limitation hand jump through the necessary hoops if you want to grab the values from the msg. That said, since you have to "setup" the tags/nodeIds before hand, then every injection of "readmultiple" should return the same set of results - so in this case, storing something in context may not be the big issue you would normally have.

Personally, I would raise an issue on the repository (link is in the npm/flows page for the node)

You can also split the message to two wires and bypass the bad node. you can then join the wires and move the require datato the correct property. You will probably need to queue the messages so only one passes the split at a time.
here is an example.

[{"id":"eef93d41a00283af","type":"inject","z":"d1395164b4eec73e","name":"OG props","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"another","v":"1234","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"test","payload":"","payloadType":"date","x":380,"y":5700,"wires":[["07c6ccabfd7610ea"]]},{"id":"07c6ccabfd7610ea","type":"delay","z":"d1395164b4eec73e","name":"queue","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"30","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":560,"y":5700,"wires":[["ff6bf1f49eb72a35","d692ed94aa6f902e"]]},{"id":"8d8711c7dea198a2","type":"function","z":"d1395164b4eec73e","name":"release queue","func":"\nreturn {flush:1};","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":730,"y":5600,"wires":[["07c6ccabfd7610ea"]]},{"id":"ff6bf1f49eb72a35","type":"function","z":"d1395164b4eec73e","name":"bad node","func":"\nreturn {payload:\"new\"}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":720,"y":5740,"wires":[["d20709cfd67a8a7d"]]},{"id":"d692ed94aa6f902e","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"join_topic","pt":"msg","to":"old","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":5680,"wires":[["6fba0ee647dfbf31"]]},{"id":"6fba0ee647dfbf31","type":"join","z":"d1395164b4eec73e","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"join_topic","joiner":"\\n","joinerType":"str","useparts":false,"accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":970,"y":5680,"wires":[["8d8711c7dea198a2","45b5239aa9b6b612"]]},{"id":"d20709cfd67a8a7d","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"complete","pt":"msg","to":"","tot":"str"},{"t":"set","p":"join_topic","pt":"msg","to":"new","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":5740,"wires":[["6fba0ee647dfbf31"]]},{"id":"45b5239aa9b6b612","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.new","tot":"msg"},{"t":"delete","p":"join_topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":5720,"wires":[["6663a469d415efbf"]]},{"id":"6663a469d415efbf","type":"debug","z":"d1395164b4eec73e","name":"debug 2582","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1130,"y":5760,"wires":[]}]

But do raise an issue.