Split value from an object


hello!
i'm new with node red
i want to know how to sent the value only
the function in the photo is empty

thanks alot

If you want to set/move a value to msg.payload, it would be best to use a change node. using a function node is over kill.
In the change node -
1 select move
2 then select msg enter the path to the value, in this case it would be payload.value[0]. The docs tell you how to get the path here.
3 in the to section select msg and enter payload

If you must use a function node, it would be

msg.payload = msg.payload.value[0];
return msg;
1 Like

There’s a great page in the docs 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.

BX00Cy7yHi

https://nodered.org/docs/user-guide/messages

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

1 Like

Thank you very much Sir

Thank you very much Sir!
I will watch it

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