Table-node doesn't show my values

Hey Guys,

i have a problem with node-red and the dashboard.
I have a working flow, which shows me the values of scanned RFID-TAGs (TagNr, Count, Time)
I used a template-node to visualize the received Data. It looked like this:

Here's the flow:

[
    {
        "id": "aeaac8000d31373d",
        "type": "tcp in",
        "z": "bda3ee9e841198c7",
        "name": "",
        "server": "server",
        "host": "192.168.40.46",
        "port": "10011",
        "datamode": "stream",
        "datatype": "buffer",
        "newline": "",
        "topic": "",
        "trim": false,
        "base64": false,
        "tls": "",
        "x": 110,
        "y": 260,
        "wires": [
            [
                "ecb02aeb341c548a"
            ]
        ]
    },
    {
        "id": "2c52e3c9ed712f92",
        "type": "debug",
        "z": "bda3ee9e841198c7",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": true,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 920,
        "y": 220,
        "wires": []
    },
    {
        "id": "53bf4121b438bbbc",
        "type": "ui_button",
        "z": "bda3ee9e841198c7",
        "name": "",
        "group": "dc3e8cbe2c286a9c",
        "order": 1,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Read/Clear",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 250,
        "y": 320,
        "wires": [
            [
                "90abb872bda98f34",
                "f9478d55658941e3"
            ]
        ]
    },
    {
        "id": "90abb872bda98f34",
        "type": "function",
        "z": "bda3ee9e841198c7",
        "name": "function 2-Reset",
        "func": "if (msg.payload === \"clearDataArray\") {\n    flow.set('dataArray', []);\n    node.warn('Data array cleared.');\n    return null;\n} else {\n    const tagNr = msg.payload.slice(16, 22).toString('hex', 0, 6);\n    const timestamp = Date.now();\n    if (!flow.get('dataArray')) {\n        flow.set('dataArray', []);\n    }\n\n    const dataArray = flow.get('dataArray');\n    const indexOfCurrentData = dataArray.findIndex((data) => data.tagNr === tagNr);\n\n    if (indexOfCurrentData === -1) {\n        dataArray.push({\n            tagNr,\n            timestamp: new Date(timestamp).toLocaleString(),\n        });\n    } else {\n        dataArray[indexOfCurrentData].timestamp = new Date(timestamp).toLocaleString();\n    }\n\n    flow.set('dataArray', dataArray);\n\n    msg.payload = JSON.stringify(dataArray);\n    \n    flow.set('dataArray', []);\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 460,
        "y": 320,
        "wires": [
            [
                "4388f20fc0dc5a81"
            ]
        ]
    },
    {
        "id": "ecb02aeb341c548a",
        "type": "function",
        "z": "bda3ee9e841198c7",
        "name": "Funktion Zähler+Bereinigung",
        "func": "const tagNr = msg.payload.slice(16, 22).toString('hex', 0, 6);\nconst timestamp = Date.now();\n\nif (!flow.get('tagCounts')) {\n    flow.set('tagCounts', {});\n}\n\nconst tagCounts = flow.get('tagCounts');\ntagCounts[tagNr] = (tagCounts[tagNr] || 0) + 1;\n\nif (!flow.get('dataArray')) {\n    flow.set('dataArray', []);\n}\n\nconst dataArray = flow.get('dataArray');\nconst indexOfCurrentData = dataArray.findIndex((data) => data.tagNr === tagNr);\n\nif (indexOfCurrentData === -1) {\n    dataArray.push({\n        tagNr,\n        count: tagCounts[tagNr],\n        timestamp: new Date(timestamp).toLocaleString(),\n    });\n} else {\n    dataArray[indexOfCurrentData].count = tagCounts[tagNr];\n    dataArray[indexOfCurrentData].timestamp = new Date(timestamp).toLocaleString();\n}\n\nflow.set('dataArray', dataArray);\nflow.set('tagCounts', tagCounts);\n\nmsg.payload = dataArray;\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 360,
        "y": 260,
        "wires": [
            [
                "53bf4121b438bbbc"
            ]
        ]
    },
    {
        "id": "f9478d55658941e3",
        "type": "function",
        "z": "bda3ee9e841198c7",
        "name": "function 3-Reset counter",
        "func": "flow.set('dataArray', []);\nflow.set('tagCounts', {});\nnode.warn('Data array and tagCounts cleared.');\nreturn null;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 450,
        "y": 400,
        "wires": [
            [
                "4388f20fc0dc5a81"
            ]
        ]
    },
    {
        "id": "4388f20fc0dc5a81",
        "type": "ui_template",
        "z": "bda3ee9e841198c7",
        "group": "dc3e8cbe2c286a9c",
        "name": "",
        "order": 1,
        "width": "6",
        "height": "14",
        "format": "<table>\n  <thead>\n    <tr>\n           <th>Tag-Nr</th>\n      <th>Count</th>\n      <th>Time</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr ng-repeat=\"data in msg.payload\">\n      <td>{{$index + 1}}</td>\n      <td>{{data.tagNr}}</td>\n      <td>{{data.count}}</td>\n      <td>{{data.timestamp}}</td>\n    </tr>\n  </tbody>\n</table>\n\n\n\n<div ng-bind-html=\"msg.payload\"></div>\n\n",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": false,
        "templateScope": "local",
        "className": "",
        "x": 700,
        "y": 220,
        "wires": [
            [
                "2c52e3c9ed712f92"
            ]
        ]
    },
    {
        "id": "dc3e8cbe2c286a9c",
        "type": "ui_group",
        "name": "Scanned TAGs",
        "tab": "9dadb6060f5c7071",
        "order": 1,
        "disp": true,
        "width": "10",
        "collapse": false,
        "className": ""
    },
    {
        "id": "9dadb6060f5c7071",
        "type": "ui_tab",
        "name": "RFID-Gate, oi!",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

but instead of a template-node, i want to use a table-node, with this flow:

[
    {
        "id": "283c27741654954d",
        "type": "function",
        "z": "bda3ee9e841198c7",
        "name": "function 5",
        "func": "const tagNr = msg.payload\nconst tagCounts = flow.get('tagCounts');\nconst timestamp = Date.now();\n\nmsg.payload = [\n    {\n        \"tagNr\": tagNr,\n        \"tagCounts\": tagCounts,\n        \"timestamp\": new Date(timestamp).toLocaleString()\n    }\n];\n\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 720,
        "y": 180,
        "wires": [
            [
                "7235bcc508b0a893"
            ]
        ]
    },
    {
        "id": "dbfe045eead58233",
        "type": "tcp in",
        "z": "bda3ee9e841198c7",
        "name": "",
        "server": "server",
        "host": "192.168.40.46",
        "port": "10011",
        "datamode": "stream",
        "datatype": "buffer",
        "newline": "",
        "topic": "",
        "trim": false,
        "base64": false,
        "tls": "",
        "x": 130,
        "y": 240,
        "wires": [
            [
                "948f310e026cd3c3"
            ]
        ]
    },
    {
        "id": "3c4752674f137c9f",
        "type": "debug",
        "z": "bda3ee9e841198c7",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": true,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 935,
        "y": 165,
        "wires": []
    },
    {
        "id": "02f235b402b49d99",
        "type": "ui_button",
        "z": "bda3ee9e841198c7",
        "name": "",
        "group": "dc3e8cbe2c286a9c",
        "order": 1,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Read/Clear",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 370,
        "y": 240,
        "wires": [
            [
                "504335430f688fd4",
                "20ed885051473bc6"
            ]
        ]
    },
    {
        "id": "504335430f688fd4",
        "type": "function",
        "z": "bda3ee9e841198c7",
        "name": "function 2-Reset",
        "func": "if (msg.payload === \"clearDataArray\") {\n    flow.set('dataArray', []);\n    node.warn('Data array cleared.');\n    return null;\n} else {\n    const tagNr = msg.payload.slice(16, 22).toString('hex', 0, 6);\n    const timestamp = Date.now();\n    if (!flow.get('dataArray')) {\n        flow.set('dataArray', []);\n    }\n\n    const dataArray = flow.get('dataArray');\n    const indexOfCurrentData = dataArray.findIndex((data) => data.tagNr === tagNr);\n\n    if (indexOfCurrentData === -1) {\n        dataArray.push({\n            tagNr,\n            timestamp: new Date(timestamp).toLocaleString(),\n        });\n    } else {\n        dataArray[indexOfCurrentData].timestamp = new Date(timestamp).toLocaleString();\n    }\n\n    flow.set('dataArray', dataArray);\n\n    msg.payload = JSON.stringify(dataArray);\n    \n    flow.set('dataArray', []);\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 610,
        "y": 240,
        "wires": [
            [
                "283c27741654954d"
            ]
        ]
    },
    {
        "id": "948f310e026cd3c3",
        "type": "function",
        "z": "bda3ee9e841198c7",
        "name": "Funktion Zähler+Bereinigung",
        "func": "const tagNr = msg.payload.slice(16, 22).toString('hex', 0, 6);\nconst timestamp = Date.now();\n\nif (!flow.get('tagCounts')) {\n    flow.set('tagCounts', {});\n}\n\nconst tagCounts = flow.get('tagCounts');\ntagCounts[tagNr] = (tagCounts[tagNr] || 0) + 1;\n\nif (!flow.get('dataArray')) {\n    flow.set('dataArray', []);\n}\n\nconst dataArray = flow.get('dataArray');\nconst indexOfCurrentData = dataArray.findIndex((data) => data.tagNr === tagNr);\n\nif (indexOfCurrentData === -1) {\n    dataArray.push({\n        tagNr,\n        count: tagCounts[tagNr],\n        timestamp: new Date(timestamp).toLocaleString(),\n    });\n} else {\n    dataArray[indexOfCurrentData].count = tagCounts[tagNr];\n    dataArray[indexOfCurrentData].timestamp = new Date(timestamp).toLocaleString();\n}\n\nflow.set('dataArray', dataArray);\nflow.set('tagCounts', tagCounts);\n\nmsg.payload = dataArray;\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 165,
        "y": 315,
        "wires": [
            [
                "02f235b402b49d99"
            ]
        ]
    },
    {
        "id": "20ed885051473bc6",
        "type": "function",
        "z": "bda3ee9e841198c7",
        "name": "function 3-Reset counter",
        "func": "flow.set('dataArray', []);\nflow.set('tagCounts', {});\nnode.warn('Data array and tagCounts cleared.');\nreturn null;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 460,
        "y": 315,
        "wires": [
            []
        ]
    },
    {
        "id": "7235bcc508b0a893",
        "type": "ui_table",
        "z": "bda3ee9e841198c7",
        "group": "dc3e8cbe2c286a9c",
        "name": "",
        "order": 2,
        "width": 0,
        "height": 0,
        "columns": [],
        "outputs": 1,
        "cts": true,
        "x": 820,
        "y": 255,
        "wires": [
            [
                "3c4752674f137c9f"
            ]
        ]
    },
    {
        "id": "dc3e8cbe2c286a9c",
        "type": "ui_group",
        "name": "Scanned TAGs",
        "tab": "9dadb6060f5c7071",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "9dadb6060f5c7071",
        "type": "ui_tab",
        "name": "RFID-Gate, oi!",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

but i dont receive any data, exept the date. Now my dashboard looks like this:

Does anyone of you know why this problem occurs?
Thanks in advance

@MrKanister, Welcome to the Forum.

Some editors can corrupt code, and make it unreadable. Besides, it is far easier for all involved in trying to help you if code is posted using the correct method...

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json

ty for the info, ive updated it

  1. your first flow has a template node with input from two function nodes. The messages from the two function nodes will not enter the template node at the same time, each will be processed separately. If you want the data from both messages, you need to use a join node to join both messages into one msg and then send it to the template name.

  2. without actual data, it will be hard to help you. Add a debug node to the output of the tcp-in node (set to display the complete msg object. Then from the debug sidebar, copy the data and paste it to a reply. If there is some sensitive data, change it to something generic.

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

The context value tagCount is set as an object in one of the many function nodes, but you set it as a tagCount in the msg.payload. So the table column is receiving an object not a value.

Hey, ty for the response.
I tried using the join node, but i wont get any datas displayed on the dashboard, nor the debuggger.
As you requested, i added a debug-node to the tcpin-node and here is the received data:

[2,0,34,0,34,0,113,0,1,0,23,132,0,8,28,0,64,0,32,0,0,3,21,57,180,154,20,2,10,3,0,4,60,161]

Stick a debug node on the output of your 'function 5' function node and look at the results. Is that the format the ui-template'\ node is looking for?

if i use a joinnode, i wont get any data at all, no matter which settings i choose.
Function 5 is intended for the table-node and not for the template-node.
But as you requested, hers the result of the debug-node connected to function 5:

Here is the "original" Dashboard with the template node and some read TAGs:

Here the flow:

Did you notice that the tagCounts object is empty? You have to determine why that is empty.

Also the button node is sending a message to both 'function 2-Reset' and 'function 3-Reset counter'. Since 'function 3-Reset counter' never returns a msg, why not combine that code into 'function 2-Reset'?

Also, 'function 2-Reset' first line is
if (msg.payload === "clearDataArray") {
but what is coming out of the button node and how does it effect 'function 2-Reset'?

if i combine the 2 codes together, the button wont clear the read TAGs, idk why, but it wokrs if i keep the 2 code seperated:

if (msg.payload === "clearDataArray") {
    flow.set('dataArray', []);
    node.warn('Data array cleared.');
    flow.set('tagCounts', {});
    node.warn('tagCounts cleared.');
    return null;
} else {
    const tagNr = msg.payload.slice(16, 22).toString('hex', 0, 6);
    const timestamp = Date.now();
    if (!flow.get('dataArray')) {
        flow.set('dataArray', []);
    }

    const dataArray = flow.get('dataArray');
    const indexOfCurrentData = dataArray.findIndex((data) => data.tagNr === tagNr);

    if (indexOfCurrentData === -1) {
        dataArray.push({
            tagNr,
            timestamp: new Date(timestamp).toLocaleString(),
        });
    } else {
        dataArray[indexOfCurrentData].timestamp = new Date(timestamp).toLocaleString();
    }

    flow.set('dataArray', dataArray);

    msg.payload = JSON.stringify(dataArray);
    
    return msg;
}

honestly, idk why tagCounts is empty.
I crafted this flow together bc im not so into coding and Node-Red

(Sorry it has taken so long to get back to you - life got in the way)
When I use the second flow (from your first post) and the sample data you provided, this is what I see in the dashboard:

This indicates that you are not configuring the output of 'function 5' properly.

Have you looked at any of the example flows for the ui-table?
If not go to the hamburger menu (top right of the editor) and select 'Import'. zClick on Examples and scroll down till you get to ui-table and import some of the examples to see how they work.

No need to apologize, im glad that you are trying to help me. Unfortunately none of the approaches worked. I checked function 5 again, tried out the imported exmaples (Ty for this tip btw), but sadly the results are always the same. Either im getting no results, or the complete Data gets squeezed in the 1. column. The counter column never works..

Lets say you have three msgs come in from the TCP-in node and one of them has a tag of 2 and two have a tag of 7.

How name rows should be displayed in the table?
My assumption is that there should be two rows with the row for tag 7 showing a count of 2 like this:

Is this correct?

Also how many tags do you expect to be displaying?

Im testing an RFID-Gate for bulkreading. So there could be around 10 and more TAGs beeing read at once. The Data beeing send from the RFID-Gate is formated in ASCII hex format:
<Buffer 02 00 22 00 22 00 71 00 01 00 17 84 00 08 18 00 35 05 00 00 00 26 01 2b 12 e8 14 02 08 16 00 08 ce a3> (Data sent to the console)
in the debugger, this code will be displayed like this:
[2,0,34,0,34,0,113,0,1,0,23,132,0,8,24,0,53,5,0,0,0,38,1,43,18,232,20,2,8,22,0,8,206,163],
resp.:
[0 … 9]
0: 0x2
1: 0x0
2: 0x22
3: 0x0
4: 0x22
5: 0x0
6: 0x71
7: 0x0
8: 0x1
9: 0x0
[10 … 19]
10: 0x17
11: 0x84
12: 0x0
13: 0x8
14: 0x18
15: 0x0
16: 0x35
17: 0x5
18: 0x0
19: 0x0
[20 … 29]
20: 0x0
21: 0x26
22: 0x1
23: 0x2b
24: 0x12
25: 0xe8
26: 0x14
27: 0x2
28: 0x8
29: 0x16
[30 … 33]
30: 0x0
31: 0x8
32: 0xce
33: 0xa3

this line of numbers include the ordinary TAG-nr and the timestamp aswell. So this line of numbers gets "cut" and formated into the TAG-Nr, like this: 35 05 00 00 00 26
with following code:

msg.payload = msg.payload.slice(16,22).toString('hex', 0, 6);
return msg;

if you want, i can give you more unformated, "raw", Data.
And according to your question, yeah your Dashboard is exactly what i hope to achieve.

The Scan-procedure is done like this, I walk through the gate with a box of RFID-TAGs, put them down, go to the dashboard and click the button, then the data should be displayed like yours, after checking which TAGs were beeing read and how often, i click the button again and everything is beeing reset. This works pretty well with the template-node (Screenshot of "original" Dashboard 2 days ago)

Try this much simplified flow

[{"id":"e3c8ce96db2e4eb1","type":"tcp in","z":"93c334b77e42a142","d":true,"name":"","server":"server","host":"192.168.40.46","port":"10011","datamode":"stream","datatype":"buffer","newline":"","topic":"","trim":false,"base64":false,"tls":"","x":190,"y":60,"wires":[["f6a57e52f2d89c3c"]]},{"id":"3cdce87341323cfa","type":"debug","z":"93c334b77e42a142","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":990,"y":160,"wires":[]},{"id":"fdc755f93601d6d4","type":"ui_button","z":"93c334b77e42a142","name":"","group":"dc3e8cbe2c286a9c","order":1,"width":0,"height":0,"passthru":false,"label":"Read","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":370,"y":200,"wires":[["54658aeb9b58bf5d"]]},{"id":"9cb3b153c6d0885b","type":"ui_table","z":"93c334b77e42a142","group":"dc3e8cbe2c286a9c","name":"","order":2,"width":0,"height":0,"columns":[],"outputs":1,"cts":true,"x":770,"y":160,"wires":[["3cdce87341323cfa"]]},{"id":"a591b47ccd0c5726","type":"inject","z":"93c334b77e42a142","name":"3","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[2,0,34,0,34,0,113,0,1,0,23,132,0,8,28,0,64,0,32,0,0,3,21,57,180,154,20,2,10,3,0,4,60,161]","payloadType":"json","x":150,"y":120,"wires":[["f6a57e52f2d89c3c"]]},{"id":"841b9cb620fef3c4","type":"inject","z":"93c334b77e42a142","name":"23","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[2,0,34,0,34,0,113,0,1,0,23,132,0,8,28,0,64,0,32,0,0,23,21,57,180,154,20,2,10,3,0,4,60,161]","payloadType":"json","x":150,"y":180,"wires":[["f6a57e52f2d89c3c"]]},{"id":"3a34931be8fb6bfd","type":"ui_button","z":"93c334b77e42a142","name":"","group":"dc3e8cbe2c286a9c","order":1,"width":0,"height":0,"passthru":false,"label":"Clear","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":370,"y":240,"wires":[["0d5cccb3d5dd9030"]]},{"id":"f6a57e52f2d89c3c","type":"function","z":"93c334b77e42a142","name":"function 13","func":"//=========================================\n// get RFID(tagNr) and current time\n//=========================================\nlet tagNr = msg.payload.slice(16, 22).toString('hex', 0, 6);\nlet timestamp = Date.now();\n\n//====================================================\n// get the tags object if it exist and populate it \n//====================================================\nlet tags = flow.get('tags') || {};\n\n// create a local tab object 't'\nlet t = tags[tagNr] ||{}\nt.count = t.count + 1 || 1\nt.timestamp = Date.now();\n\n// add the tag object to flow 'tags'\ntags[tagNr] = t\nflow.set('tags', tags);\n\n//====================================================\n// Build the dataArray to display in the ui-table \n//====================================================\nlet dataArray = [];\n\n// Creat an object for each tabs object and add it as\n// an array entry that can be displayed in the ui-table\nlet d = {}\nfor (const key in tags) {\n    d = { \"tagNr\": \"\", \"count\": 0, \"timestamp\": 0 }\n    d['tagNr'] = key\n    d['count'] = (tags[key].count)\n    d['timestamp'] = (tags[key].timestamp)\n\n    dataArray.push(d);\n}\nflow.set('dataArray', dataArray);\n// send current table to ui-table\nmsg.payload = dataArray\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":120,"wires":[["9cb3b153c6d0885b"]]},{"id":"54658aeb9b58bf5d","type":"change","z":"93c334b77e42a142","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"dataArray","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":200,"wires":[["9cb3b153c6d0885b"]]},{"id":"703b488b8bbb1510","type":"inject","z":"93c334b77e42a142","name":"70","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[2,0,34,0,34,0,113,0,1,0,23,132,0,8,28,0,64,0,32,0,0,70,21,57,180,154,20,2,10,3,0,4,60,161]","payloadType":"json","x":150,"y":240,"wires":[["f6a57e52f2d89c3c"]]},{"id":"0d5cccb3d5dd9030","type":"change","z":"93c334b77e42a142","name":"clean out flow variables","rules":[{"t":"delete","p":"dataArray","pt":"flow"},{"t":"delete","p":"tags","pt":"flow"},{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":240,"wires":[["9cb3b153c6d0885b"]]},{"id":"dc3e8cbe2c286a9c","type":"ui_group","name":"Scanned TAGs","tab":"9dadb6060f5c7071","order":1,"disp":true,"width":"12","collapse":false,"className":""},{"id":"9dadb6060f5c7071","type":"ui_tab","name":"RFID-Gate, oi!","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

Ty very much for your help!
Your code wasnt quite working as I expected but I used some snippets of it, to adapt my Flow. No it works the way i wanted it.
You were very helpful :slight_smile:

Just for my information, what part wasn't working as you expected?
I probably just didn't understand your requirements completely

Tbh, i was dumb.
I changed the nodes a little bit and adjusted the delete-function. It was helpful, watching the "tutorials" you sent me.
I can give you my working flow:

[
    {
        "id": "89b73386957cc292",
        "type": "function",
        "z": "bda3ee9e841198c7",
        "name": "function 5",
        "func": "const tagNr = msg.payload;\nconst tagCounts = flow.get('tagCounts');\nconst timestamp = Date.now();\n\nconst formattedData = Object.keys(tagCounts).map((tag) => ({\n    TagNr: tag,\n    Count: tagCounts[tag],\n    Timestamp: new Date(timestamp).toLocaleString(),\n}));\n\nmsg.payload = formattedData;\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 800,
        "y": 175,
        "wires": [
            [
                "02259568a0eb7ebd",
                "c90eb7c79f5ccfbb"
            ]
        ]
    },
    {
        "id": "079cc281ca5cd6f8",
        "type": "tcp in",
        "z": "bda3ee9e841198c7",
        "name": "",
        "server": "server",
        "host": "192.168.40.46",
        "port": "10011",
        "datamode": "stream",
        "datatype": "buffer",
        "newline": "",
        "topic": "",
        "trim": false,
        "base64": false,
        "tls": "",
        "x": 150,
        "y": 180,
        "wires": [
            [
                "cf8f970f064b7754"
            ]
        ]
    },
    {
        "id": "c90eb7c79f5ccfbb",
        "type": "debug",
        "z": "bda3ee9e841198c7",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": true,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 975,
        "y": 280,
        "wires": []
    },
    {
        "id": "cf8f970f064b7754",
        "type": "function",
        "z": "bda3ee9e841198c7",
        "name": "Funktion Counter+Adjustment",
        "func": "const tagNr = msg.payload.slice(16, 22).toString('hex', 0, 6);\nconst timestamp = Date.now();\n\nif (!flow.get('tagCounts')) {\n    flow.set('tagCounts', {});\n}\n\nconst tagCounts = flow.get('tagCounts');\ntagCounts[tagNr] = (tagCounts[tagNr] || 0) + 1;\n\nif (!flow.get('dataArray')) {\n    flow.set('dataArray', []);\n}\n\nconst dataArray = flow.get('dataArray');\nconst indexOfCurrentData = dataArray.findIndex((data) => data.tagNr === tagNr);\n\nif (indexOfCurrentData === -1) {\n    dataArray.push({\n        tagNr,\n        count: tagCounts[tagNr],\n        timestamp: new Date(timestamp).toLocaleString(),\n    });\n} else {\n    dataArray[indexOfCurrentData].count = tagCounts[tagNr];\n    dataArray[indexOfCurrentData].timestamp = new Date(timestamp).toLocaleString();\n}\n\nflow.set('dataArray', dataArray);\nflow.set('tagCounts', tagCounts);\n\nmsg.payload = dataArray;\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 550,
        "y": 180,
        "wires": [
            [
                "89b73386957cc292"
            ]
        ]
    },
    {
        "id": "02259568a0eb7ebd",
        "type": "ui_table",
        "z": "bda3ee9e841198c7",
        "group": "dc3e8cbe2c286a9c",
        "name": "",
        "order": 2,
        "width": "10",
        "height": "15",
        "columns": [],
        "outputs": 0,
        "cts": false,
        "x": 975,
        "y": 190,
        "wires": []
    },
    {
        "id": "6d4231c4b35699a7",
        "type": "ui_button",
        "z": "bda3ee9e841198c7",
        "name": "",
        "group": "dc3e8cbe2c286a9c",
        "order": 1,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Clear",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 430,
        "y": 280,
        "wires": [
            [
                "ae062fc997bb0659"
            ]
        ]
    },
    {
        "id": "ae062fc997bb0659",
        "type": "function",
        "z": "bda3ee9e841198c7",
        "name": "function 6-delete",
        "func": "const resetValues = true; // Variable zum Zurücksetzen der Werte\n\nif (resetValues) {\n    flow.set('tagCounts', {}); // Setze die Tag-Zählungen zurück\n    flow.set('dataArray', []); // Setze das Datenarray zurück\n}\n\nmsg.payload = []; // Leeres Array für die Table-Node-Daten\n\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 670,
        "y": 280,
        "wires": [
            [
                "02259568a0eb7ebd"
            ]
        ]
    },
    {
        "id": "dc3e8cbe2c286a9c",
        "type": "ui_group",
        "name": "RFID-Gate",
        "tab": "9dadb6060f5c7071",
        "order": 1,
        "disp": true,
        "width": "10",
        "collapse": false,
        "className": ""
    },
    {
        "id": "9dadb6060f5c7071",
        "type": "ui_tab",
        "name": "Tab 1",
        "icon": "dashboard",
        "order": 1
    }
]