Node-red ui-table not working on IBM cloud

I am unable to create a table using ui-table node . i want to form a table having items , number,fresh,rotten,price ..pls help.....here is the flow

[{"id":"c592cb53.2f9348","type":"tab","label":"Flow 7","disabled":false,"info":""},{"id":"f09f4c40.1c21","type":"ui_table","z":"c592cb53.2f9348","group":"946b55ad.3a3508","name":"table","order":0,"width":0,"height":0,"columns":[{"field":"item","title":"item","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"total_no","title":"total_no","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"fresh","title":"fresh","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"rotten","title":"rotten","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"price","title":"price","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}}],"outputs":1,"cts":true,"x":530,"y":260,"wires":[["ea1423c2.a461d"]]},{"id":"6f69dd19.29c4e4","type":"function","z":"c592cb53.2f9348","name":"build table","func":"msg.payload= [\n   {\n    item: \"apple\",\n    total_no: 30,\n    fresh: 20,\n    rotten: 10,\n    price: 300\n   },\n   {\n    item: \"banana\",\n    total_no: 20,\n    fresh: 10,\n    rotten: 10,\n    price: 200\n       \n   },\n   {\n       item: \"orange\",\n    total_no: 15,\n    fresh: 10,\n    rotten: 5,\n    price: 150\n   }\n]\n\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":340,"wires":[["f09f4c40.1c21"]]},{"id":"46b91e2b.04961","type":"inject","z":"c592cb53.2f9348","name":"","topic":"","payload":"[{    item: \"apple\",    total_no: 30,    fresh: 20,    rotten: 10,    price: 300   },   {    item: \"banana\",    total_no: 20,    fresh: 10,    rotten: 10,    price: 200          },   {       item: \"orange\",    total_no: 15,    fresh: 10,    rotten: 5,    price: 150   }]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":260,"wires":[["6f69dd19.29c4e4"]]},{"id":"9d1984e3.9c1528","type":"ui_text","z":"c592cb53.2f9348","group":"946b55ad.3a3508","order":1,"width":0,"height":0,"name":"","label":"Apples :15 Rs/kg  Banana: 20 Rs/kg  Orange: 10 Rs/kg","format":"{{msg.payload}}","layout":"row-spread","x":620,"y":120,"wires":[]},{"id":"f091ab93.445328","type":"inject","z":"c592cb53.2f9348","name":"","topic":"","payload":"warehouse","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":120,"wires":[["9d1984e3.9c1528"]]},{"id":"ea1423c2.a461d","type":"debug","z":"c592cb53.2f9348","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":690,"y":320,"wires":[]},{"id":"946b55ad.3a3508","type":"ui_group","z":"","name":"product_details","tab":"dbe0851f.b936a8","order":1,"disp":true,"width":"6","collapse":false},{"id":"dbe0851f.b936a8","type":"ui_tab","z":"","name":"warehouse","icon":"dashboard","order":3,"disabled":false,"hidden":false}]

Welcome to the forum @ani15.

It seems to be working fine. I just deleted a wrong configuration in your inject node. If you revise the inject node it is going to work.

a-1

@Andrei thank you so much ....
can you pls tell what all changes you made in the inject node ?..since i am new to node red ..
I greatly appreciate your help.. ...

Hint: the keys need to be quoted

1 Like

@zenofmud thanks for it ...i tried it but the table is not being displayed on the dashboard ...here is the change that i made

[{"id":"c592cb53.2f9348","type":"tab","label":"Flow 7","disabled":false,"info":""},{"id":"46b91e2b.04961","type":"inject","z":"c592cb53.2f9348","name":"","topic":"","payload":"[{\"item\":\"apple\",\"total_no\":30,\"fresh\":20,\"rotten\":10,\"price\":300},{\"item\":\"banana\",\"total_no\":20,\"fresh\":10,\"rotten\":10,\"price\":200},{\"item\":\"orange\",\"total_no\":15,\"fresh\":10,\"rotten\":5,\"price\":150}]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":260,"wires":[["6f69dd19.29c4e4"]]},{"id":"9d1984e3.9c1528","type":"ui_text","z":"c592cb53.2f9348","group":"946b55ad.3a3508","order":1,"width":"6","height":"1","name":"","label":"Apples :15 Rs/kg  Banana: 20 Rs/kg  Orange: 10 Rs/kg","format":"{{msg.payload}}","layout":"row-spread","x":680,"y":120,"wires":[]},{"id":"f091ab93.445328","type":"inject","z":"c592cb53.2f9348","name":"","topic":"","payload":"warehouse","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":120,"wires":[["9d1984e3.9c1528"]]},{"id":"ea1423c2.a461d","type":"debug","z":"c592cb53.2f9348","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":690,"y":380,"wires":[]},{"id":"f09f4c40.1c21","type":"ui_table","z":"c592cb53.2f9348","group":"73d43d77.7b91f4","name":"table","order":0,"width":0,"height":0,"columns":[{"field":"item","title":"item","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"total_no","title":"total_no","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"fresh","title":"fresh","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"rotten","title":"rotten","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"price","title":"price","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}}],"outputs":1,"cts":true,"x":570,"y":260,"wires":[["35a392b.1f5876e"]]},{"id":"6f69dd19.29c4e4","type":"function","z":"c592cb53.2f9348","name":"build table","func":"msg.payload= [\n    {\n        item: \"apple\",\n        total_no: 30,\n        fresh: 20,\n        rotten: 10,\n        price: 300\n    },\n    \n    {\n        item: \"banana\",\n        total_no: 20,\n        fresh: 10,\n        rotten: 10,\n        price: 200\n    },\n    {\n        item: \"orange\",\n        total_no: 15,\n        fresh: 10,\n        rotten: 5,\n        price: 150\n    }\n]\n\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":400,"wires":[["f09f4c40.1c21","ea1423c2.a461d"]]},{"id":"35a392b.1f5876e","type":"debug","z":"c592cb53.2f9348","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":780,"y":240,"wires":[]},{"id":"946b55ad.3a3508","type":"ui_group","z":"","name":"product_details","tab":"dbe0851f.b936a8","order":1,"disp":true,"width":"6","collapse":false},{"id":"73d43d77.7b91f4","type":"ui_group","z":"","name":"table","tab":"dbe0851f.b936a8","order":2,"disp":true,"width":"6","collapse":false},{"id":"dbe0851f.b936a8","type":"ui_tab","z":"","name":"warehouse","icon":"dashboard","order":3,"disabled":false,"hidden":false}] 

Your latest flow works fine for me. Did you refresh the browser window and clear the browser cache?

As @zenofmud mentioned the JSON object inside the inject node is malformed. Since you redefine the object again in the next node everything will work if you inject a timestamp instead of injecting that object.

@Andrei @ani15 I think what can be conusing is that in an inject node, using the {} JSON option to build the object, you must put double quotes around the key, while in a function node you can omit the double quotes around the key.

Get in a habit of always using the double quotes around the key when building an object. That will make it easier in the future.

2 Likes

@zenofmud
sorry ...its not coming in my dashboard ... can u pls send the flow if if you made any changes in it ...

Your flow with a very simple change.

[{"id":"b2aa91db.5fb1f","type":"tab","label":"Flow 7","disabled":false,"info":""},{"id":"9e964622.982608","type":"ui_table","z":"b2aa91db.5fb1f","group":"e0fe5bac.f83838","name":"table","order":0,"width":0,"height":0,"columns":[{"field":"item","title":"item","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"total_no","title":"total_no","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"fresh","title":"fresh","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"rotten","title":"rotten","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"price","title":"price","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}}],"outputs":1,"cts":true,"x":530,"y":260,"wires":[["2c9241ed.df066e"]]},{"id":"e64f282f.6dd618","type":"function","z":"b2aa91db.5fb1f","name":"build table","func":"msg.payload= [\n   {\n    item: \"apple\",\n    total_no: 30,\n    fresh: 20,\n    rotten: 10,\n    price: 300\n   },\n   {\n    item: \"banana\",\n    total_no: 20,\n    fresh: 10,\n    rotten: 10,\n    price: 200\n       \n   },\n   {\n       item: \"orange\",\n    total_no: 15,\n    fresh: 10,\n    rotten: 5,\n    price: 150\n   }\n]\n\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":340,"wires":[["9e964622.982608"]]},{"id":"98fd6dc0.af81c","type":"inject","z":"b2aa91db.5fb1f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":260,"wires":[["e64f282f.6dd618"]]},{"id":"74721e16.0c56e","type":"ui_text","z":"b2aa91db.5fb1f","group":"e0fe5bac.f83838","order":1,"width":0,"height":0,"name":"","label":"Apples :15 Rs/kg  Banana: 20 Rs/kg  Orange: 10 Rs/kg","format":"{{msg.payload}}","layout":"row-spread","x":620,"y":120,"wires":[]},{"id":"ae65fe86.27901","type":"inject","z":"b2aa91db.5fb1f","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"warehouse","payloadType":"str","x":220,"y":120,"wires":[["74721e16.0c56e"]]},{"id":"2c9241ed.df066e","type":"debug","z":"b2aa91db.5fb1f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":690,"y":320,"wires":[]},{"id":"e0fe5bac.f83838","type":"ui_group","z":"","name":"product_details","tab":"6f73047a.e05b2c","order":1,"disp":true,"width":"6","collapse":false},{"id":"6f73047a.e05b2c","type":"ui_tab","z":"","name":"warehouse","icon":"dashboard","order":3,"disabled":false,"hidden":false}]
1 Like

I made no changes to the flow you last provided.

What version of NR, node.js and the dashboard are you on? You can find this information in the startup log.

@zenofmud i am using node red version 1.0.6. .. by the way i am using node red through IBM cloud using a lite account which will allocate 512 bytes at maximum..i hope that is not causing the problem

That could be, but I have no way to check.

my ui table output is not being displayed in the debug sidebar also when connected it to debug node and it seems that the msg is somehow not going to the table node from the function node or something like that since on checking the output of the function through debug node i am getting the output on the debug bar but not in case of ui-table node.....any possible solution to this ?

I've just changed the title of the thread to reflect this issue is happening on the IBM cloud. That might attract the attention of someone what will have experience with it.

@zenofmud thank you so much for your help.....highly appreciated ....

Hi, Did you find solution to this? I am also facing the same problem in IBM Cloud.

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