UI-Table Refresh Issues

Hi all, I know there has been quite a few discussions related to getting the ui-table node to update on new data. I just wanted to share something odd I found and how I got it to work in my case.

I had some rest API data going through a function node to massage the data a bit then straight to the ui-table node. The data would refresh every second and I couldn't get the table to update no matter what I did. However if I copied the payload into a couple inject node, I could toggle the table data no problem.

Maybe this will help somebody in the future.

After some trial and error, I found out that if the message had the property 'socketid', it would not work not matter what, even if it was blank. once I got rid of the 'socketid' property from the message the table would update with each new data sent to it. Easy peasy. Any thoughts on why 'socketid' is doing this?

I'll attach a flow to show what I'm talking about. First time trying this, lets see if it works.

[{"id":"ae8cda8e6f5c9ca2","type":"tab","label":"Flow 7","disabled":false,"info":""},{"id":"540489560c4ee770","type":"inject","z":"ae8cda8e6f5c9ca2","name":"Toggle 1 (not working)","props":[{"p":"payload"},{"p":"ui_control","v":"{\"height\":\"664px\",\"tabulator\":{\"columns\":[{\"title\":\" <div style='text-align:center'>#</div>\",\"field\":\"id\",\"width\":15,\"formatter\":\"rowSelection\",\"align\":\"center\"},{\"title\":\" <div style='text-align:center'>Tag Name</div>\",\"field\":\"tagName\",\"align\":\"left\",\"formatter\":\"text\",\"width\":150,\"layout\":\"fitData\"},{\"title\":\" <div style='text-align:center'>Value</div>\",\"field\":\"value\",\"formatter\":\"text\",\"width\":100,\"sorter\":\"alphanum\",\"sorterParams\":{\"alignEmptyValues\":\"bottom\"},\"layout\":\"fitData\",\"align\":\"center\"}],\"initialSort\":[{\"column\":\"tagName\",\"dir\":\"asc\"}],\"setSort\":[{\"column\":\"tagName\",\"dir\":\"asc\"}],\"layout\":\"fitColumns\",\"movableColumns\":false,\"resizableColumns\":false,\"headerVisible\":true,\"headerSort\":false,\"autoColumns\":false,\"selectable\":true}}","vt":"json"},{"p":"socketid","v":"6F0eJwu1Gskw_4VvAACj","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"id\":0,\"tagName\":\"Value 1\",\"value\":\"100\"},{\"id\":1,\"tagName\":\"Value 2\",\"value\":\"100\"},{\"id\":2,\"tagName\":\"Value 3\",\"value\":\"100\"}]","payloadType":"json","x":380,"y":320,"wires":[["69d09b35aa7f1522"]]},{"id":"69d09b35aa7f1522","type":"ui_table","z":"ae8cda8e6f5c9ca2","group":"0031795c86e8f153","name":"","order":5,"width":6,"height":6,"columns":[],"outputs":0,"cts":false,"x":670,"y":420,"wires":[]},{"id":"4fc575418b94e056","type":"inject","z":"ae8cda8e6f5c9ca2","name":"Toggle 2 (not working)","props":[{"p":"payload"},{"p":"ui_control","v":"{\"height\":\"664px\",\"tabulator\":{\"columns\":[{\"title\":\" <div style='text-align:center'>#</div>\",\"field\":\"id\",\"width\":15,\"formatter\":\"rowSelection\",\"align\":\"center\"},{\"title\":\" <div style='text-align:center'>Tag Name</div>\",\"field\":\"tagName\",\"align\":\"left\",\"formatter\":\"text\",\"width\":150,\"layout\":\"fitData\"},{\"title\":\" <div style='text-align:center'>Value</div>\",\"field\":\"value\",\"formatter\":\"text\",\"width\":100,\"sorter\":\"alphanum\",\"sorterParams\":{\"alignEmptyValues\":\"bottom\"},\"layout\":\"fitData\",\"align\":\"center\"}],\"initialSort\":[{\"column\":\"tagName\",\"dir\":\"asc\"}],\"setSort\":[{\"column\":\"tagName\",\"dir\":\"asc\"}],\"layout\":\"fitColumns\",\"movableColumns\":false,\"resizableColumns\":false,\"headerVisible\":true,\"headerSort\":false,\"autoColumns\":false,\"selectable\":true}}","vt":"json"},{"p":"socketid","v":"6F0eJwu1Gskw_4VvAACj","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"id\":0,\"tagName\":\"Value 1\",\"value\":\"50\"},{\"id\":1,\"tagName\":\"Value 2\",\"value\":\"50\"},{\"id\":2,\"tagName\":\"Value 3\",\"value\":\"50\"}]","payloadType":"json","x":380,"y":360,"wires":[["69d09b35aa7f1522"]]},{"id":"91b0ca920060b994","type":"inject","z":"ae8cda8e6f5c9ca2","name":"Toggle 1 (working)","props":[{"p":"payload"},{"p":"ui_control","v":"{\"height\":\"664px\",\"tabulator\":{\"columns\":[{\"title\":\" <div style='text-align:center'>#</div>\",\"field\":\"id\",\"width\":15,\"formatter\":\"rowSelection\",\"align\":\"center\"},{\"title\":\" <div style='text-align:center'>Tag Name</div>\",\"field\":\"tagName\",\"align\":\"left\",\"formatter\":\"text\",\"width\":150,\"layout\":\"fitData\"},{\"title\":\" <div style='text-align:center'>Value</div>\",\"field\":\"value\",\"formatter\":\"text\",\"width\":100,\"sorter\":\"alphanum\",\"sorterParams\":{\"alignEmptyValues\":\"bottom\"},\"layout\":\"fitData\",\"align\":\"center\"}],\"initialSort\":[{\"column\":\"tagName\",\"dir\":\"asc\"}],\"setSort\":[{\"column\":\"tagName\",\"dir\":\"asc\"}],\"layout\":\"fitColumns\",\"movableColumns\":false,\"resizableColumns\":false,\"headerVisible\":true,\"headerSort\":false,\"autoColumns\":false,\"selectable\":true}}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"id\":0,\"tagName\":\"Value 1\",\"value\":\"100\"},{\"id\":1,\"tagName\":\"Value 2\",\"value\":\"100\"},{\"id\":2,\"tagName\":\"Value 3\",\"value\":\"100\"}]","payloadType":"json","x":370,"y":460,"wires":[["69d09b35aa7f1522"]]},{"id":"6a7825f0ce8907d2","type":"inject","z":"ae8cda8e6f5c9ca2","name":"Toggle 2 (working)","props":[{"p":"payload"},{"p":"ui_control","v":"{\"height\":\"664px\",\"tabulator\":{\"columns\":[{\"title\":\" <div style='text-align:center'>#</div>\",\"field\":\"id\",\"width\":15,\"formatter\":\"rowSelection\",\"align\":\"center\"},{\"title\":\" <div style='text-align:center'>Tag Name</div>\",\"field\":\"tagName\",\"align\":\"left\",\"formatter\":\"text\",\"width\":150,\"layout\":\"fitData\"},{\"title\":\" <div style='text-align:center'>Value</div>\",\"field\":\"value\",\"formatter\":\"text\",\"width\":100,\"sorter\":\"alphanum\",\"sorterParams\":{\"alignEmptyValues\":\"bottom\"},\"layout\":\"fitData\",\"align\":\"center\"}],\"initialSort\":[{\"column\":\"tagName\",\"dir\":\"asc\"}],\"setSort\":[{\"column\":\"tagName\",\"dir\":\"asc\"}],\"layout\":\"fitColumns\",\"movableColumns\":false,\"resizableColumns\":false,\"headerVisible\":true,\"headerSort\":false,\"autoColumns\":false,\"selectable\":true}}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"id\":0,\"tagName\":\"Value 1\",\"value\":\"50\"},{\"id\":1,\"tagName\":\"Value 2\",\"value\":\"50\"},{\"id\":2,\"tagName\":\"Value 3\",\"value\":\"50\"}]","payloadType":"json","x":370,"y":500,"wires":[["69d09b35aa7f1522"]]},{"id":"10eabed919b20b27","type":"ui_spacer","z":"ae8cda8e6f5c9ca2","name":"spacer","group":"0031795c86e8f153","order":4,"width":5,"height":1},{"id":"0031795c86e8f153","type":"ui_group","name":"Group 1","tab":"6e46c6cdf6ac1f8e","order":1,"disp":true,"width":6},{"id":"6e46c6cdf6ac1f8e","type":"ui_tab","name":"Tab 1","icon":"dashboard","order":1}]
1 Like

Have a look on the solution for below post.

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