# Node-red-ui-table don't refresh automatically

**URL:** <https://discourse.nodered.org/t/node-red-ui-table-dont-refresh-automatically/89268>\
**Category:** General\
**Created:** [4 July 2024 16:43 UTC](https://discourse.nodered.org/t/node-red-ui-table-dont-refresh-automatically/89268 "2024-07-04T16:43:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [4 July 2024 17:06 UTC](https://discourse.nodered.org/t/node-red-ui-table-dont-refresh-automatically/89268/2 "2024-07-04T17:06:46Z")

</div>

Once you send data to the table you need to use commands to update it with new data.  
There are plenty of examples flows, which you can access from the editor.  
menu \> import \> examples \> ui-table

You can update the whole table using `replaceData` or you can add rows as shown in the editor examples.

here is an example of replacing the whole data set, as that is what you are attempting in your example flow.

```auto
[{"id":"2f67ebdfe05368a8","type":"ui_table","z":"d1395164b4eec73e","group":"475b1ea5d099553a","name":"","order":9,"width":"12","height":"5","columns":[{"field":"Name","title":"Groepsnaam","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"Speeltijd","title":"Speeltijd","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"Straftijd","title":"Straftijd","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}}],"outputs":0,"cts":false,"x":630,"y":160,"wires":[]},{"id":"7efafbb18d1f7f81","type":"function","z":"d1395164b4eec73e","name":"vul eindespel score","func":"var tabledata = global.get(\"savedata\") ||[];\n\nvar t = global.get(\"timeElapsed\") / 1000; //ms naar sec\nvar h = Math.floor(t / 3600);\nvar m = Math.floor(t % 3600 / 60);\nvar s = Math.floor(t % 3600 % 60);\nvar formattijd = (\"0\" + h).slice(-2) + \":\" + (\"0\" + m).slice(-2) + \":\" + (\"0\" + s).slice(-2);\n\ntabledata.unshift({\n \"Name\": \"pepe\",\n \"Speeltijd\": formattijd,\n \"Straftijd\": global.get(\"Straftijd\")\n });\n\nmsg.payload = {\n command:\"replaceData\",\n arguments:[tabledata]\n};\n\nglobal.set(\"savedata\", tabledata);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":180,"wires":[["2f67ebdfe05368a8"]]},{"id":"84fce77886d70f14","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"savedata","pt":"global","to":"[]","tot":"json"},{"t":"set","p":"payload","pt":"msg","to":"[]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":120,"wires":[["2f67ebdfe05368a8"]]},{"id":"846d8fd7b5dd34e6","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":180,"wires":[["7efafbb18d1f7f81"]]},{"id":"baeef06c6f68d64e","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":120,"wires":[["84fce77886d70f14"]]},{"id":"475b1ea5d099553a","type":"ui_group","name":"Eindscore","tab":"6c20ebed9219bf3d","order":1,"disp":true,"width":"12","collapse":false,"className":""},{"id":"6c20ebed9219bf3d","type":"ui_tab","name":"Eindscore","icon":"dashboard","disabled":false,"hidden":false}]

```

---

_[View the full topic](https://discourse.nodered.org/t/node-red-ui-table-dont-refresh-automatically/89268)._
