I have multiple messages going into this node; and then into another function where I want to split the values out so I can do an if this equals that etc. So some how I need to have the message come into the second function node that is specific so I can tag the variables specific to the message.
Probably a bad explanation.....sure this simple.
Cheers,
Ant
Apologies it is probably the worst explanation possiable.
So i have three nodes outputting numbers (msg.payload) each with a different topic; ie the name of the variable.
I want to bring them into a single function block and do an if 1 = 2 < 3 (for example); How do I set the value into a variable, that is specific to a topic; so as the message comes in they are all msg.payload; but I need to split them up and place in the correct variable.
I've only ever had one variable or one JSON string come into the function block; not multipe messages.
You can join the 3 messages with a join node set to manual and key value object, you use the 3 different topics to create a payload. Try it and see what you get. You can set the join on a count or a time out, or you can send msg.complete to output the new combined object.
There is a example in the cookbook , and many in this forum.