Table-node doesn't show my values

You could simplify your code in many parts. For instance you code this

if (!flow.get('tagCounts')) {
    flow.set('tagCounts', {});
}

const tagCounts = flow.get('tagCounts');

which could easily be changed to this:

let tagCounts = flow.get('tagCounts') || {};

In 'function 6-delete' you have

const resetValues = true; // Variable zum Zurücksetzen der Werte

if (resetValues) {
    flow.set('tagCounts', {}); // Setze die Tag-Zählungen zurück
    flow.set('dataArray', []); // Setze das Datenarray zurück
}

msg.payload = []; // Leeres Array für die Table-Node-Daten

return msg;

the first two lines are not needed. You could change the code to:

//reset the flow variables
flow.set('tagCounts', {}); // Setze die Tag-Zählungen zurück
flow.set('dataArray', []); // Setze das Datenarray zurück}

msg.payload = []; // Leeres Array für die Table-Node-Daten
return msg;

You should also read up on 'var, let and const' NOTE: const variables can neither be updated nor re-declared.

2 Likes

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