Splitting an array of objects

That is what I was trying to get clarification on


@Tomadoggy this will do what you asked - fully dynamic / works for multiple rows & any amount of columns...

image

The function code

for (let i = 0; i < msg.payload.length; i++) {
    const el = msg.payload[i];
    const entries = Object.entries(el).map(([topic, payload]) => ({ topic, payload, row: (i+1) }));
    node.send([entries]);
}
2 Likes