Setting msg.something

I am working on making changes to flows that have no be changed or ran since summer if last year. Back then I had heavily made use of msg.something = something in function nodes. I am changing to make to the code but something is working.

Where is like what I have in the node from back then
msg.TalkID = msg.payload[0].TalkID.toString();
This would set msg.TalkID to what was returned from mysql.

In testing I have even tried msg.TalkID = 1; and cant not get it to set.

TLDR has something changed in nodered that will not let me set msg.something if so what is the work around.

Can you paste the code from your function node in a reply. Also connect a debug node to the output of what ever is feeding the function and show us what the msg entering the function node looks like.

Here is a sample flow

[{"id":"7c739125.fa17a8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"627e2c20.b552b4","type":"inject","z":"7c739125.fa17a8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":141,"y":173,"wires":[["7bd9fcda.5c39e4"]]},{"id":"7bd9fcda.5c39e4","type":"function","z":"7c739125.fa17a8","name":"setting var","func":"msg.ID = 1;\nmsg.filename = \"test.mkv\";\nreturn msg;\n","outputs":1,"noerr":0,"x":346,"y":176,"wires":[["8991332.ae6cc5"]]},{"id":"8991332.ae6cc5","type":"debug","z":"7c739125.fa17a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":577.5,"y":173,"wires":[]}]

Here is debug
image

version 1.0.3 of node red

In your flow, you have the debug node set to msg only instead of complete msg object.
If I change it to show the complete msg object, I see this in the debug sidebar. Is this what you expected to see?
If not, what did you expect to see?

OMG WTF, I have been pulling my hair out for the past few weeks over this. Thank you for your help

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