# Buffer list\_ui input?

**URL:** <https://discourse.nodered.org/t/buffer-list-ui-input/29708>\
**Category:** Dashboard\
**Created:** [8 July 2020 09:50 UTC](https://discourse.nodered.org/t/buffer-list-ui-input/29708 "2020-07-08T09:50:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MasterOfPuppets](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@MasterOfPuppets](https://discourse.nodered.org/u/MasterOfPuppets)\
**Post date:** [8 July 2020 09:50 UTC](https://discourse.nodered.org/t/buffer-list-ui-input/29708/1 "2020-07-08T09:50:02Z")

</div>

Hello Guys,

after many nights my rfid reader dashboard looks the way i want to and works great.

The last thing i want to have is a logger that shows me the last users who access the reader.

I want to do this with the "ui-list" [https://flows.nodered.org/node/node-red-node-ui-list](https://flows.nodered.org/node/node-red-node-ui-list)

after a bit of testing, i do a inject node for example, formatted with a json code, to show me in the list what i wanted.

I build a second example inject node, but this replaced the first information, but i want a "growing list".... i was aware off....

Till i find the node "ring-buffer" [https://flows.nodered.org/node/node-red-contrib-ring-buffer](https://flows.nodered.org/node/node-red-contrib-ring-buffer).

I was very happy, that is exactly the node iam looking for, i can set the maximal capacity of messages and sort them from old to new and so on.

if you put a meesage in it stacks the messages, till the size is reached.

my problem is now, how to format the output of the ring buffer correct to display the "growing list" in my ui-list node.

i hope someone can help me.

This works like i want, but replaces the message before:

```auto
[{"id":"415371c4.bf4fd","type":"ui_list","z":"c7a9e01b.3778c","group":"bb9f2da2.5fec9","name":"","order":1,"width":"12","height":"5","lineType":"two","actionType":"none","allowHTML":true,"outputs":0,"topic":"","x":1590,"y":1000,"wires":[]},{"id":"8a2854c.cb931a8","type":"inject","z":"c7a9e01b.3778c","name":"Pierre","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"title\":\"<b>Pierre</b>\",\"description\":\"Am <font color=\\\"yellow\\\"><b>23.07.2020</b></font color> um <font color=\\\"yellow\\\"><b>23.17 Uhr</b>.\",\"icon\":null}]","payloadType":"json","x":1230,"y":980,"wires":[["415371c4.bf4fd"]]},{"id":"dd52fe2.4068","type":"inject","z":"c7a9e01b.3778c","name":"Alessandro","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"title\":\"<b>Alessandro</b>\",\"description\":\"Am <font color=\\\"yellow\\\"><b>21.07.2020</b></font color> um <font color=\\\"yellow\\\"><b>11.32 Uhr</b>.\",\"icon\":null}]","payloadType":"json","x":1220,"y":1020,"wires":[["415371c4.bf4fd"]]},{"id":"bb9f2da2.5fec9","type":"ui_group","z":"","name":"Letzte Benutzer","tab":"11f55352.a4e0dd","order":1,"disp":true,"width":"14","collapse":false},{"id":"11f55352.a4e0dd","type":"ui_tab","z":"","name":"Log","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

```

This stacks the messages like i want, but i dont know how to format the ring-buffer output to work with the ui-list:

```auto
[{"id":"108cb558.2669fb","type":"ui_list","z":"c7a9e01b.3778c","group":"bb9f2da2.5fec9","name":"","order":1,"width":"12","height":"5","lineType":"two","actionType":"none","allowHTML":true,"outputs":0,"topic":"","x":1590,"y":1140,"wires":[]},{"id":"9206a3c4.fe052","type":"inject","z":"c7a9e01b.3778c","name":"Pierre","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"title\":\"<b>Pierre</b>\",\"description\":\"Am <font color=\\\"yellow\\\"><b>23.07.2020</b></font color> um <font color=\\\"yellow\\\"><b>23.17 Uhr</b>.\",\"icon\":null}]","payloadType":"json","x":1230,"y":1120,"wires":[["d6d7d8d.c507528"]]},{"id":"590281b7.b8aa","type":"inject","z":"c7a9e01b.3778c","name":"Alessandro","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"title\":\"<b>Alessandro</b>\",\"description\":\"Am <font color=\\\"yellow\\\"><b>21.07.2020</b></font color> um <font color=\\\"yellow\\\"><b>11.32 Uhr</b>.\",\"icon\":null}]","payloadType":"json","x":1220,"y":1160,"wires":[["d6d7d8d.c507528"]]},{"id":"d6d7d8d.c507528","type":"ring-buffer","z":"c7a9e01b.3778c","name":"","capacity":"100","order":"new-to-old","sendOnlyIfFull":false,"pushAfterClear":false,"extra":false,"perTopic":false,"x":1420,"y":1140,"wires":[["108cb558.2669fb"]]},{"id":"bb9f2da2.5fec9","type":"ui_group","z":"","name":"Letzte Benutzer","tab":"11f55352.a4e0dd","order":1,"disp":true,"width":"14","collapse":false},{"id":"11f55352.a4e0dd","type":"ui_tab","z":"","name":"Log","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

```

thank you!

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [8 July 2020 10:34 UTC](https://discourse.nodered.org/t/buffer-list-ui-input/29708/2 "2020-07-08T10:34:33Z")

</div>

Please edit your post above after reading this - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![MasterOfPuppets](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@MasterOfPuppets](https://discourse.nodered.org/u/MasterOfPuppets)\
**Post date:** [8 July 2020 21:55 UTC](https://discourse.nodered.org/t/buffer-list-ui-input/29708/3 "2020-07-08T21:55:23Z")

</div>

Hey Paul, sorry for that, now it should be right formattet!

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [9 July 2020 00:25 UTC](https://discourse.nodered.org/t/buffer-list-ui-input/29708/4 "2020-07-09T00:25:32Z")

</div>

Note that the ring buffer node will push each piece of data as an element of an array. The ui\_list expect exactly that, an array of objects. Your second flow is not working for a subtle reason. You are injecting an array of objects to the ring buffer. If you change the flow to inject a single object (instead of an array) it will work.

Probably a flow is worth one thousand words. I changed only the way you inject the data.

```auto
[{"id":"d2747612.7225d8","type":"ui_list","z":"85385f4e.6ebc6","group":"b8a2179e.8899a8","name":"","order":1,"width":"12","height":"5","lineType":"two","actionType":"none","allowHTML":true,"x":610,"y":160,"wires":[]},{"id":"a3498625.f08a18","type":"inject","z":"85385f4e.6ebc6","name":"Pierre","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"title\":\"<b>Pierre</b>\",\"description\":\"Am <font color=\\\"yellow\\\"><b>23.07.2020</b></font color> um <font color=\\\"yellow\\\"><b>23.17 Uhr</b>.\",\"icon\":null}","payloadType":"json","x":250,"y":140,"wires":[["a8833634.d727d8"]]},{"id":"11f53cc2.7ff343","type":"inject","z":"85385f4e.6ebc6","name":"Alessandro","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"title\":\"<b>Alessandro</b>\",\"description\":\"Am <font color=\\\"yellow\\\"><b>21.07.2020</b></font color> um <font color=\\\"yellow\\\"><b>11.32 Uhr</b>.\",\"icon\":null}","payloadType":"json","x":240,"y":180,"wires":[["a8833634.d727d8"]]},{"id":"a8833634.d727d8","type":"ring-buffer","z":"85385f4e.6ebc6","name":"","capacity":"100","order":"new-to-old","sendOnlyIfFull":false,"pushAfterClear":false,"extra":false,"perTopic":false,"x":440,"y":160,"wires":[["d2747612.7225d8","eef86ec7.86b8a"]]},{"id":"eef86ec7.86b8a","type":"debug","z":"85385f4e.6ebc6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":620,"y":220,"wires":[]},{"id":"b8a2179e.8899a8","type":"ui_group","z":"","name":"Letzte Benutzer","tab":"63f44113.80ba3","order":1,"disp":true,"width":"14","collapse":false},{"id":"63f44113.80ba3","type":"ui_tab","z":"","name":"Log","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![MasterOfPuppets](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@MasterOfPuppets](https://discourse.nodered.org/u/MasterOfPuppets)\
**Post date:** [9 July 2020 09:57 UTC](https://discourse.nodered.org/t/buffer-list-ui-input/29708/5 "2020-07-09T09:57:49Z")

</div>

Thank you very much Andrei 😃

I'm a bit slow today 🤦‍♂️

Now i have another question and i hope you can help me again.

i now use a template node and put in the JSON like in the inject node before, now when i push the template with an standart timestamp inject node, it works too =)

```auto
[{"id":"f71dbe35.86004","type":"ui_list","z":"c7a9e01b.3778c","group":"db5d92b.b4f487","name":"","order":1,"width":"14","height":"5","lineType":"two","actionType":"none","allowHTML":true,"outputs":0,"topic":"","x":1990,"y":980,"wires":[]},{"id":"9faee303.c17f5","type":"ring-buffer","z":"c7a9e01b.3778c","name":"","capacity":"100","order":"new-to-old","sendOnlyIfFull":false,"pushAfterClear":false,"extra":false,"perTopic":false,"x":1820,"y":980,"wires":[["f71dbe35.86004","31039bad.921614"]]},{"id":"31039bad.921614","type":"debug","z":"c7a9e01b.3778c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":2000,"y":1040,"wires":[]},{"id":"a21c3a19.c00f98","type":"template","z":"c7a9e01b.3778c","name":"","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":"{\"title\":\"<b>Pierre</b>\",\"description\":\"Am <font color=\\\"yellow\\\"><b>22.07</b></font color> um <font color=\\\"yellow\\\"><b>23.17 Uhr</b>.\",\"icon\":null}","output":"json","x":1620,"y":980,"wires":[["9faee303.c17f5"]]},{"id":"f896f2d7.199e9","type":"inject","z":"c7a9e01b.3778c","name":"","props":[{"p":"payload"},{"p":"name","v":"Pierre","vt":"str"},{"p":"time","v":"23.08","vt":"str"},{"p":"date","v":"22.07.2020","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1440,"y":980,"wires":[["a21c3a19.c00f98"]]},{"id":"db5d92b.b4f487","type":"ui_group","z":"","name":"Letzte Benutzer","tab":"ed5bb1a8.a2d52","order":1,"disp":true,"width":"14","collapse":false},{"id":"ed5bb1a8.a2d52","type":"ui_tab","z":"","name":"Log","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

```

Next step is to change the parameters in the template node dynamic.... but im not getting the infos from the inject node for msg.name, msg.time and msg.date displayed right =(

```auto
[{"id":"f33bd027.b856","type":"ui_list","z":"c7a9e01b.3778c","group":"db5d92b.b4f487","name":"","order":1,"width":"14","height":"5","lineType":"two","actionType":"none","allowHTML":true,"outputs":0,"topic":"","x":1990,"y":800,"wires":[]},{"id":"60b3308d.d1127","type":"ring-buffer","z":"c7a9e01b.3778c","name":"","capacity":"100","order":"new-to-old","sendOnlyIfFull":false,"pushAfterClear":false,"extra":false,"perTopic":false,"x":1820,"y":800,"wires":[["f33bd027.b856","9f90d6ae.470d98"]]},{"id":"9f90d6ae.470d98","type":"debug","z":"c7a9e01b.3778c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":2000,"y":860,"wires":[]},{"id":"18b68885.624857","type":"template","z":"c7a9e01b.3778c","name":"","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":"{\"title\":\"<b>{{msg.name}}</b>\",\"description\":\"Am <font color=\\\"yellow\\\"><b>{{msg.date}}</b></font color> um <font color=\\\"yellow\\\"><b>{{msg.time}}</b>.\",\"icon\":null}","output":"json","x":1620,"y":800,"wires":[["60b3308d.d1127"]]},{"id":"355f59b0.eb91e6","type":"inject","z":"c7a9e01b.3778c","name":"","props":[{"p":"payload"},{"p":"name","v":"Pierre","vt":"str"},{"p":"time","v":"23.08","vt":"str"},{"p":"date","v":"22.07.2020","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1440,"y":800,"wires":[["18b68885.624857"]]},{"id":"db5d92b.b4f487","type":"ui_group","z":"","name":"Letzte Benutzer","tab":"ed5bb1a8.a2d52","order":1,"disp":true,"width":"14","collapse":false},{"id":"ed5bb1a8.a2d52","type":"ui_tab","z":"","name":"Log","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

```

With a function instead of the template node also no luck =(

```auto
[{"id":"f71dbe35.86004","type":"ui_list","z":"c7a9e01b.3778c","group":"db5d92b.b4f487","name":"","order":1,"width":"14","height":"5","lineType":"two","actionType":"none","allowHTML":true,"outputs":0,"topic":"","x":1990,"y":980,"wires":[]},{"id":"9faee303.c17f5","type":"ring-buffer","z":"c7a9e01b.3778c","name":"","capacity":"100","order":"new-to-old","sendOnlyIfFull":false,"pushAfterClear":false,"extra":false,"perTopic":false,"x":1820,"y":980,"wires":[["f71dbe35.86004","31039bad.921614"]]},{"id":"31039bad.921614","type":"debug","z":"c7a9e01b.3778c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":2000,"y":1040,"wires":[]},{"id":"f896f2d7.199e9","type":"inject","z":"c7a9e01b.3778c","name":"","props":[{"p":"payload"},{"p":"name","v":"Pierre","vt":"str"},{"p":"time","v":"23.08","vt":"str"},{"p":"date","v":"22.07.2020","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1440,"y":980,"wires":[["73c1b708.a0d148"]]},{"id":"73c1b708.a0d148","type":"function","z":"c7a9e01b.3778c","name":"","func":"msg.payload = {\n \"title\": \"<b>msg.name</b>\",\n \"description\": \"Am <font color=\\\"yellow\\\"><b>msg.date</b></font color> um <font color=\\\"yellow\\\"><b>msg.time</b>.\",\n \"icon\": null\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1620,"y":980,"wires":[["9faee303.c17f5"]]},{"id":"db5d92b.b4f487","type":"ui_group","z":"","name":"Letzte Benutzer","tab":"ed5bb1a8.a2d52","order":1,"disp":true,"width":"14","collapse":false},{"id":"ed5bb1a8.a2d52","type":"ui_tab","z":"","name":"Log","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

```

Thank you very much again!

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 July 2020 10:36 UTC](https://discourse.nodered.org/t/buffer-list-ui-input/29708/6 "2020-07-09T10:36:35Z")

</div>

> [@MasterOfPuppets](#):
>
> but im not getting the infos from the inject node for msg.name, msg.time and msg.date displayed right =(

Usually, to access `msg` items in the template, leave off the `msg.` part.

e.g. if your debug shows values you want in `msg.date` then put `{{date}}` in the template. if your debug shows values you want in `msg.payload.date` then put `{{payload.date}}` in the template.

---

<div class="post-metadata">

**Author:** ![MasterOfPuppets](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@MasterOfPuppets](https://discourse.nodered.org/u/MasterOfPuppets)\
**Post date:** [9 July 2020 12:33 UTC](https://discourse.nodered.org/t/buffer-list-ui-input/29708/7 "2020-07-09T12:33:20Z")

</div>

Thank you steve, i will test it, when iam at home from work. =)

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [9 July 2020 14:43 UTC](https://discourse.nodered.org/t/buffer-list-ui-input/29708/8 "2020-07-09T14:43:28Z")

</div>

Further to what Steve explained above make sure you configure the template node as below:

![a-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/a/9a2527b9fd48decc05e987043cbcb12b3c2d119d.png)

---

<div class="post-metadata">

**Author:** ![MasterOfPuppets](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@MasterOfPuppets](https://discourse.nodered.org/u/MasterOfPuppets)\
**Post date:** [14 July 2020 05:34 UTC](https://discourse.nodered.org/t/buffer-list-ui-input/29708/9 "2020-07-14T05:34:49Z")

</div>

Thank you both very much! Works like a charm!

---

<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:** [28 July 2020 05:34 UTC](https://discourse.nodered.org/t/buffer-list-ui-input/29708/10 "2020-07-28T05:34:50Z")

</div>

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