# Table-node doesn't show my values

**URL:** <https://discourse.nodered.org/t/table-node-doesnt-show-my-values/78688>\
**Category:** Dashboard\
**Created:** [25 May 2023 11:36 UTC](https://discourse.nodered.org/t/table-node-doesnt-show-my-values/78688 "2023-05-25T11:36:29Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [5 June 2023 11:53 UTC](https://discourse.nodered.org/t/table-node-doesnt-show-my-values/78688/21 "2023-06-05T11:53:42Z")

</div>

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

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

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

```

which could easily be changed to this:

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

```

In 'function 6-delete' you have

```auto
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:

```auto
//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'](https://blog.javascripttoday.com/blog/var-vs-let-vs-const/) NOTE: **const** variables can neither be updated nor re-declared.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [19 June 2023 11:54 UTC](https://discourse.nodered.org/t/table-node-doesnt-show-my-values/78688/22 "2023-06-19T11:54:40Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/table-node-doesnt-show-my-values/78688.md?page=1)
