Hello,
I am a newby with Node-Red.
I search to implement a simple function.
Info is coming from TouchDesigner through OSC (udp) as:
{"address":"/videoShow","args":0}
I want to change property of group with args (two values, 0 and 1)
I wrote this function:
I see two possible causes: msg.args is not of type Number or msg.args does not exist.
In the first case, you can replace the three equals (===) operator with the double equals (==) to do type conversion of the operands before comparison.
If the data type is correct, are you sure you are not confusing msg.args with msg.payload.args?
There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.
Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.
Thank you for your quick and kind answers.
I tried msg.payload, msg.payload.args, msg.args with == and === and nothing works
Finaly I opted for the easy visual programing solution : switch (on msg.payload) and 2 x change (on Set msg.payload)
Its working,
Have a nice evening (here in Paris),
Jacques
Sure, I would like to resolve the problem!
Here is what I obtain with msg.payload.args
27/10/2022 23:13:15node: debug 2bundle : msg.payload : Object
object
group: object
hide: array[1]
0: "Demo_video"