# Refreshing ui\_table

**URL:** <https://discourse.nodered.org/t/refreshing-ui-table/87632>\
**Category:** Dashboard\
**Created:** [1 May 2024 20:25 UTC](https://discourse.nodered.org/t/refreshing-ui-table/87632 "2024-05-01T20:25:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Caporeira](https://avatars.discourse-cdn.com/v4/letter/c/6bbea6/32.png) [@Caporeira](https://discourse.nodered.org/u/Caporeira)\
**Post date:** [1 May 2024 20:25 UTC](https://discourse.nodered.org/t/refreshing-ui-table/87632/1 "2024-05-01T20:25:29Z")

</div>

When I click twice on the Error button, why does it show only one entry in the table, and after a manual refresh, why does it show both entries?  
How to fix it?

```auto
[{"id":"471994f81dc05b58","type":"ui_table","z":"8d0978fa5349c413","group":"group-id","name":"MessagesTable","order":22,"width":"0","height":"0","columns":[{"field":"timestamp","title":"Date / Time","width":"","align":"center","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"message","title":"Message","width":"","align":"center","formatter":"plaintext","formatterParams":{"target":"_blank"}}],"outputs":0,"cts":false,"x":800,"y":480,"wires":[]},{"id":"345ff202eb8658fd","type":"debug","z":"8d0978fa5349c413","name":"debug 2521","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":780,"y":520,"wires":[]},{"id":"8aa0b57b96b18d73","type":"function","z":"8d0978fa5349c413","name":"updateTable","func":"var timestamp = new Date().getTime();\nvar date = new Date(timestamp);\nvar readableDate = date.toLocaleString();\n\nvar messageContent = \"Error\";\n\nvar newRow = {\n timestamp: readableDate,\n message: messageContent\n};\n\nvar messages = flow.get('messages') || [];\n\nmessages.unshift(newRow);\n\nif (messages.length > 5) {\n messages.length = 5;\n}\n\nflow.set('messages', messages);\n\nmsg.payload = messages;\n\nvar controlMsg = {ui_control: {callback: \"update\"}};\ndelete msg.socketid\nreturn [msg, controlMsg];","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":520,"wires":[["471994f81dc05b58","345ff202eb8658fd"]]},{"id":"43ed59b3babe136a","type":"function","z":"8d0978fa5349c413","name":"resetTable","func":"flow.set('messages', []);\nmsg.payload = [];\ndelete msg.socketid\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":480,"wires":[["471994f81dc05b58"]]},{"id":"634583e49ca39726","type":"link in","z":"8d0978fa5349c413","name":"link in 4","links":["3e9c8b726253b695"],"x":455,"y":520,"wires":[["8aa0b57b96b18d73"]]},{"id":"e39debd06002e510","type":"ui_template","z":"8d0978fa5349c413","group":"group-id","name":"Reset","order":10,"width":3,"height":1,"format":"<md-button class=\"vibrate filled touched smallfont rounded\" style=\"background-color:#616A6B\" ng-click=\"send({payload: 'Hello World'})\"> \n Reset<br/>\n</md-button> \n\n","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":true,"templateScope":"local","className":"","x":430,"y":480,"wires":[["43ed59b3babe136a"]]},{"id":"8365569f07a9e36f","type":"ui_template","z":"8d0978fa5349c413","group":"group-id","name":"Error","order":2,"width":3,"height":3,"format":"<md-button class=\"vibrate filled touched bigfont rounded\" style=\"background-color:#c0392b\" ng-click=\"send({payload: 2})\"> \n Error<br/>\n</md-button> \n\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":210,"y":520,"wires":[["3e9c8b726253b695"]]},{"id":"3e9c8b726253b695","type":"link out","z":"8d0978fa5349c413","name":"link out 6","mode":"link","links":["634583e49ca39726"],"x":305,"y":520,"wires":[]},{"id":"group-id","type":"ui_group","name":"Default","tab":"tab-id","order":1,"disp":true,"width":"6","collapse":false},{"id":"tab-id","type":"ui_tab","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [1 May 2024 20:53 UTC](https://discourse.nodered.org/t/refreshing-ui-table/87632/2 "2024-05-01T20:53:32Z")

</div>

Have you looked at the ui-table examples, you will find them in editor.  
Press ctrl I \> examples \> ui-table  
Take a look at commands on how to add a row.

---

<div class="post-metadata">

**Author:** ![Caporeira](https://avatars.discourse-cdn.com/v4/letter/c/6bbea6/32.png) [@Caporeira](https://discourse.nodered.org/u/Caporeira)\
**Post date:** [2 May 2024 10:18 UTC](https://discourse.nodered.org/t/refreshing-ui-table/87632/3 "2024-05-02T10:18:52Z")

</div>

Did you mean the example on that site?

> **[node-red-node-ui-table](https://flows.nodered.org/node/node-red-node-ui-table)**
>
> Table UI widget node for Node-RED Dashboard

Ctrl+i or Ctrl+L seems not to be working properly (is it 'i' or 'L'?).  
Additionally, I have implemented that function (to add row), but it appears not to solve my problem.

```auto
var controlMsg = {
    ui_control: {
        callback: 'update',
        tabulator: {
            addRow: newRow
        }
    }
};

```

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [2 May 2024 11:30 UTC](https://discourse.nodered.org/t/refreshing-ui-table/87632/4 "2024-05-02T11:30:48Z")

</div>

No, in the node-red flow editor press `control I` or select import in the side menu

 ![chrome_screenshot_2 May 2024 12_29_03 BST](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/5/35d2833f4bad5dc69b1ced591aa8624a41d9f12f.png)  
The command flow has examples of adding rows.

---

<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:** [16 May 2024 11:31 UTC](https://discourse.nodered.org/t/refreshing-ui-table/87632/5 "2024-05-16T11:31:16Z")

</div>

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