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...
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]);
}