Loop Function for JSON table

Hi there,

I am a newer user of node-red, and I'm attempting to use a function that will read directly from a JSON table and spit out all the values in order so that it can be read in a line chart. However when i try to make such loop it does not seem to spit out any values at all.

var newMsg = { payload: msg.payload.length };
var i = newMsg;

for (x = 0; x < i; x++)
return payload[1].V;

msg.payload = msg.payload[i].V
return msg

I am curious to know if there is a better way to approach this formula or if minor tweaking is needed. Thanks in advance for the help!

I suggest you start by reading the node red doc Writing Functions. That should help to get you going.
However if by table you actually mean that the payload coming in is an array then have a look at the Split node which will do exactly what you want I believe.