How to seperate value from incoming msg.payload?

If you want to send each one of those values in the array out of a different output then you can use a Function node with the number of outputs set to 8, containing something like

// payload contains an array of values, build an array of messages containing those values
let msgs = msg.payload.map(myFunction)
return msgs

function myFunction(x) {
    return {payload: x}
}

That uses the Array map() function to convert the array values into an array of messages containing those values in msg.payload.

1 Like