# Error fetching node ui-table data

**URL:** <https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593>\
**Category:** Dashboard\
**Tags:** function-node\
**Created:** [22 February 2023 16:03 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593 "2023-02-22T16:03:33Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![gennaro](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gennaro](https://discourse.nodered.org/u/gennaro)\
**Post date:** [22 February 2023 16:03 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/1 "2023-02-22T16:03:33Z")

</div>

Hello, I'm new to Node-Red and with gaps in javascript, I'm studying node ui-table. I have implemented the ability to change a value in a cell, but I can't recover the typed change. When I try to retrieve the value of msg.ui\_control.changes.newValue I get the following error: TypeError: Cannot read properties of undefined (reading 'changes').  
Help in solving the problem is welcome.

```auto
[
    {
        "id": "591cd40f23ae1233",
        "type": "tab",
        "label": "Flow 5",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "0c95f6e04aa2191d",
        "type": "inject",
        "z": "591cd40f23ae1233",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 100,
        "y": 60,
        "wires": [
            [
                "6b11cbd3bff5feb5"
            ]
        ]
    },
    {
        "id": "77beef291e58df96",
        "type": "mysql",
        "z": "591cd40f23ae1233",
        "mydb": "fded45f38ac71b78",
        "name": "",
        "x": 120,
        "y": 160,
        "wires": [
            [
                "c3e82eca2cd3e823"
            ]
        ]
    },
    {
        "id": "c3e82eca2cd3e823",
        "type": "function",
        "z": "591cd40f23ae1233",
        "name": "function 28",
        "func": "var output = [];\nfor (var i = 0; i < msg.payload.length; i++) {\n var row = {};\n row.id = msg.payload[i].id;\n row.DATA = msg.payload[i].DATA;\n row.NAME = msg.payload[i].NAME;\n row.AGE = msg.payload[i].AGE;\n row.COLORE = msg.payload[i].COLORE;\n output.push(row);\n}\n\nmsg.payload = output;\nmsg.ui_control = {\n \"tabulator\": {\n \"columnResized\": \"function(column){var newColumn = { field: column._column.field, visible: column._column.visible, width: column._column.width, widthFixed: column._column.widthFixed, widthStyled: column._column.widthStyled }; this.send({topic:this.config.topic,ui_control:{callback:'columnResized',columnWidths:newColumn}}); }\",\n \"columnMoved\": \"function(column, columns){ var newColumns=[]; columns.forEach(function (column) { newColumns.push({'field': column._column.field}); }); this.send({topic:this.config.topic,ui_control:{callback:'columnMoved',columns:newColumns}}); }\",\n \"groupHeader\": \"function (value, count, data, group) {return value + \\\"<span style='color:#d00; margin-left:10px;'>(\\\" + count + \\\" Termostat\\\"+((count>1) ? \\\"e\\\" : \\\"\\\") + \\\")</span>\\\";}\",\n \"columns\": [\n { \"formatterParams\": { \"target\": \"_blank\" }, \"title\": \"Id\", \"field\": \"id\", \"width\": 100, \"align\": \"center\" },\n { \"formatterParams\": { \"target\": \"_blank\" }, \"title\": \"Data\", \"field\": \"DATA\", \"width\": 100, \"align\": \"center\" },\n { \"formatterParams\": { \"target\": \"_blank\" }, \"title\": \"Nome\", \"field\": \"NAME\", \"width\": 100, \"align\": \"center\" },\n { \"formatterParams\": { \"target\": \"_blank\" }, \"title\": \"Anni\", \"field\": \"AGE\", \"width\": 100, \"editor\": \"input\" },\n { \"formatterParams\": { \"target\": \"_blank\" }, \"title\": \"Colore\", \"field\": \"COLORE\", \"width\": 100, \"align\": \"center\" },\n],\n //\"cellEdited\":\"function(cell){this.send({ui_control:{callback:'cellEdited'},payload:cell.getValue(),oldValue:cell.getOldValue(),field:cell.getColumn().getField(),id:cell.getRow().getCell('id').getValue()}); }\",\n \"cellEdited\": \"function(cell){var change = {newValue:cell.getValue()};this.send({topic:this.config.topic,ui_control:{callback:'cellEdited',changes:change}});}\",\n \"layout\": \"fitColumns\",\n \"movableColumns\": true,\n \"groupBy\": \"\"\n },\n \"customHeight\": 12\n}\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 300,
        "y": 160,
        "wires": [
            [
                "5048d05c2c8d3979"
            ]
        ]
    },
    {
        "id": "6b11cbd3bff5feb5",
        "type": "function",
        "z": "591cd40f23ae1233",
        "name": "function 29",
        "func": "var select = \"SELECT ID AS id, DATA, NAME, AGE, COLORE\" +\n \" FROM TEST\" +\n \" ORDER BY STR_TO_DATE(DATA, '%e-%c-%Y') ASC;\";\nmsg.topic = select;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 280,
        "y": 60,
        "wires": [
            [
                "77beef291e58df96"
            ]
        ]
    },
    {
        "id": "5048d05c2c8d3979",
        "type": "ui_table",
        "z": "591cd40f23ae1233",
        "group": "b703f34de6178e44",
        "name": "tabella",
        "order": 1,
        "width": "14",
        "height": "7",
        "columns": [],
        "outputs": 1,
        "cts": true,
        "x": 450,
        "y": 180,
        "wires": [
            [
                "d74bce060ac86841",
                "ac5ffe1704e21f53"
            ]
        ]
    },
    {
        "id": "d74bce060ac86841",
        "type": "function",
        "z": "591cd40f23ae1233",
        "name": "function 30",
        "func": "let a = Object(msg.payload);\nlet b = a.id;\nlet c = msg.topic;\nlet d = msg.ui_control.changes.newValue;\n\nmsg.payload = {\n idd: b,\n campo: c,\n// nuovo: d,\n};\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 650,
        "y": 180,
        "wires": [
            [
                "cf4ad65dd1644bf6"
            ]
        ]
    },
    {
        "id": "ac5ffe1704e21f53",
        "type": "debug",
        "z": "591cd40f23ae1233",
        "name": "debug 84",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 690,
        "y": 60,
        "wires": []
    },
    {
        "id": "cf4ad65dd1644bf6",
        "type": "debug",
        "z": "591cd40f23ae1233",
        "name": "debug 85",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 800,
        "y": 180,
        "wires": []
    },
    {
        "id": "fded45f38ac71b78",
        "type": "MySQLdatabase",
        "name": "",
        "host": "172.18.0.11",
        "port": "3306",
        "db": "node-red",
        "tz": "",
        "charset": "UTF8"
    },
    {
        "id": "b703f34de6178e44",
        "type": "ui_group",
        "name": "Group 1",
        "tab": "9dd218d0a686108d",
        "order": 1,
        "disp": true,
        "width": 20
    },
    {
        "id": "9dd218d0a686108d",
        "type": "ui_tab",
        "name": "Test",
        "icon": "dashboard",
        "order": 3,
        "disabled": false,
        "hidden": false
    }
]

```

---

<div class="post-metadata">

**Author:** ![gennaro](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gennaro](https://discourse.nodered.org/u/gennaro)\
**Post date:** [23 February 2023 18:49 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/2 "2023-02-23T18:49:44Z")

</div>

Continuing the discussion from [Error fetching node ui-table data](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593):  
good evening everyone, I managed to extract the data but I get them in 2 different msg and since I have to save them on a db I can't figure it out.

```auto
let a = Object(msg.payload)['id'];
let b = Object(msg.topic);
let c = Object(msg.ui_control);
let cc = Object(c.changes)['newValue'];
msg = {
    id: a,
    campo: b,
    newV: cc,
   };

return msg;

```

![Cattura1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/38345cfa3e45e0b52b47809d37a79ae65fcd0d79.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [23 February 2023 21:33 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/3 "2023-02-23T21:33:52Z")

</div>

Can you show the input to the `function` node?

---

<div class="post-metadata">

**Author:** ![gennaro](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gennaro](https://discourse.nodered.org/u/gennaro)\
**Post date:** [24 February 2023 09:46 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/4 "2023-02-24T09:46:33Z")

</div>

Good morning and thank you for your interest.  
meanwhile I went ahead with my tests and I modified my flow, now if I wanted to insert a mysql node after the function node how do I discard the first msg that is undefinend and take only the second?  
 ![Cattura3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/4/e4d03af5b273e31d37d388f5bd51e0a1a27cd605.png)

```auto
[
    {
        "id": "0bb94ab71fd44f0d",
        "type": "tab",
        "label": "Flow 6",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "e767dc20f61a4278",
        "type": "inject",
        "z": "0bb94ab71fd44f0d",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[{\"id\":1,\"DATA\":\"12-09-1983\",\"NAME\":\"Kazuhito Yokoi\",\"AGE\":50,\"COLORE\":\"red\"},{\"id\":2,\"DATA\":\"12-08-2017\",\"NAME\":\"Oli Bob\",\"AGE\":12,\"COLORE\":\"cyan\"}]",
        "payloadType": "json",
        "x": 90,
        "y": 80,
        "wires": [
            [
                "f3706a2d57441c86"
            ]
        ]
    },
    {
        "id": "f3706a2d57441c86",
        "type": "change",
        "z": "0bb94ab71fd44f0d",
        "name": "ui_control",
        "rules": [
            {
                "t": "set",
                "p": "ui_control",
                "pt": "msg",
                "to": "{\"tabulator\":{\"columnResized\":\"function(column){var newColumn = { field: column._column.field, visible: column._column.visible, width: column._column.width, widthFixed: column._column.widthFixed, widthStyled: column._column.widthStyled }; this.send({topic:this.config.topic,ui_control:{callback:'columnResized',columnWidths:newColumn}}); }\",\"columnMoved\":\"function(column, columns){ var newColumns=[]; columns.forEach(function (column) { newColumns.push({'field': column._column.field}); }); this.send({topic:this.config.topic,ui_control:{callback:'columnMoved',columns:newColumns}}); }\",\"groupHeader\":\"function (value, count, data, group) {return value + \\\"<span style='color:#d00; margin-left:10px;'>(\\\" + count + \\\" Termostat\\\"+((count>1) ? \\\"e\\\" : \\\"\\\") + \\\")</span>\\\";}\",\"columns\":[{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Id\",\"field\":\"id\",\"width\":100,\"align\":\"center\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Data\",\"field\":\"DATA\",\"width\":100,\"align\":\"center\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Nome\",\"field\":\"NAME\",\"width\":100,\"align\":\"center\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Anni\",\"field\":\"AGE\",\"width\":100,\"editor\":\"input\",\"topCalc\":\"sum\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Colore\",\"field\":\"COLORE\",\"width\":100,\"align\":\"center\"}],\"cellEdited\":\"function(cell){var change = {idValue:cell.getRow().getIndex(),newValue:cell.getValue(),oldValue:cell.getOldValue(),field:cell.getColumn().getField()};this.send({topic:this.config.topic,ui_control:{callback:'cellEdited',changes:change}});}\",\"layout\":\"fitColumns\",\"movableColumns\":true,\"groupBy\":\"\"},\"customHeight\":12}",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 260,
        "y": 80,
        "wires": [
            [
                "038f4d061f1d7841"
            ]
        ]
    },
    {
        "id": "038f4d061f1d7841",
        "type": "ui_table",
        "z": "0bb94ab71fd44f0d",
        "group": "6ea6e760f5405df8",
        "name": "tabella",
        "order": 1,
        "width": "14",
        "height": "7",
        "columns": [],
        "outputs": 1,
        "cts": true,
        "x": 430,
        "y": 80,
        "wires": [
            [
                "ae5a0174dcce6cab"
            ]
        ]
    },
    {
        "id": "ae5a0174dcce6cab",
        "type": "function",
        "z": "0bb94ab71fd44f0d",
        "name": "function 33",
        "func": "let c = Object(msg.ui_control);\nlet ca = Object(c.changes)['idValue'];\nlet cb = parseFloat(Object(c.changes)['newValue']);\nlet cc = Object(c.changes)['oldValue'];\nlet cd = Object(c.changes)['field'];\n\n//var up = \"UPDATE TEST SET AGE = \" + cb + \" WHERE ID = \" + ca + \";\";\n//msg.topic = up;\nmsg = {\n id: ca,\n newV: cb,\n oldV: cc,\n campo: cd,\n };\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 590,
        "y": 80,
        "wires": [
            [
                "6074bc525273faa0"
            ]
        ]
    },
    {
        "id": "6074bc525273faa0",
        "type": "debug",
        "z": "0bb94ab71fd44f0d",
        "name": "debug 92",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 760,
        "y": 80,
        "wires": []
    },
    {
        "id": "6ea6e760f5405df8",
        "type": "ui_group",
        "name": "Default",
        "tab": "63c69e4a2cbdd7f6",
        "order": 1,
        "disp": true,
        "width": 20,
        "collapse": false,
        "className": ""
    },
    {
        "id": "63c69e4a2cbdd7f6",
        "type": "ui_tab",
        "name": "Home",
        "icon": "Dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [24 February 2023 10:00 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/5 "2023-02-24T10:00:25Z")

</div>

The debug you are showing is not the same as what the `inject` in your current flow sends. When I click onto table, the `function` node returns:

![Screenshot 2023-02-24 at 4.59.46 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/b/bb3b3146cdb546ac2b518a62dbf9f8284ab03004.png)

Put a `debug` node (set to display the complete msg object) on the output of the `ui-table` node so you can see what you are passing to the `function` node.

---

<div class="post-metadata">

**Author:** ![gennaro](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gennaro](https://discourse.nodered.org/u/gennaro)\
**Post date:** [24 February 2023 10:50 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/6 "2023-02-24T10:50:31Z")

</div>

Hi I can't see the error on the input and I don't think there are any. the problem lies in the output of the table node on the modification from the front-end on the column and the debug returns 2 msg

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [24 February 2023 11:32 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/7 "2023-02-24T11:32:44Z")

</div>

Sorry I should have been clearer. When I your flow and go to the dashboard and click on the table, the debug node shows an error that dose not match your output.

It is quite possible you are doing something else but I don’t know what. This is why a step by step list of what you have done is helpful to people trying to help you.

---

<div class="post-metadata">

**Author:** ![gennaro](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gennaro](https://discourse.nodered.org/u/gennaro)\
**Post date:** [24 February 2023 12:14 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/8 "2023-02-24T12:14:02Z")

</div>

Anyway, thanks for the time you're dedicating to me, I reset the output msg of the function node specifying the type of msg.payload and now the debug node returns a clearer msg.  
As you can see, the debug returns a msg.payload with the fields at NaN or undefined and a msg.ui\_control with the correct values.  
The two msgs are generated at the same time as the field in the age column is updated.

```auto
[
    {
        "id": "0bb94ab71fd44f0d",
        "type": "tab",
        "label": "Flow 6",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "e767dc20f61a4278",
        "type": "inject",
        "z": "0bb94ab71fd44f0d",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[{\"id\":1,\"DATA\":\"12-09-1983\",\"NAME\":\"Kazuhito Yokoi\",\"AGE\":50,\"COLORE\":\"red\"},{\"id\":2,\"DATA\":\"12-08-2017\",\"NAME\":\"Oli Bob\",\"AGE\":12,\"COLORE\":\"cyan\"}]",
        "payloadType": "json",
        "x": 90,
        "y": 80,
        "wires": [
            [
                "f3706a2d57441c86"
            ]
        ]
    },
    {
        "id": "f3706a2d57441c86",
        "type": "change",
        "z": "0bb94ab71fd44f0d",
        "name": "ui_control",
        "rules": [
            {
                "t": "set",
                "p": "ui_control",
                "pt": "msg",
                "to": "{\"tabulator\":{\"columnResized\":\"function(column){var newColumn = { field: column._column.field, visible: column._column.visible, width: column._column.width, widthFixed: column._column.widthFixed, widthStyled: column._column.widthStyled }; this.send({topic:this.config.topic,ui_control:{callback:'columnResized',columnWidths:newColumn}}); }\",\"columnMoved\":\"function(column, columns){ var newColumns=[]; columns.forEach(function (column) { newColumns.push({'field': column._column.field}); }); this.send({topic:this.config.topic,ui_control:{callback:'columnMoved',columns:newColumns}}); }\",\"groupHeader\":\"function (value, count, data, group) {return value + \\\"<span style='color:#d00; margin-left:10px;'>(\\\" + count + \\\" Termostat\\\"+((count>1) ? \\\"e\\\" : \\\"\\\") + \\\")</span>\\\";}\",\"columns\":[{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Id\",\"field\":\"id\",\"width\":100,\"align\":\"center\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Data\",\"field\":\"DATA\",\"width\":100,\"align\":\"center\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Nome\",\"field\":\"NAME\",\"width\":100,\"align\":\"center\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Anni\",\"field\":\"AGE\",\"width\":100,\"editor\":\"input\",\"topCalc\":\"sum\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Colore\",\"field\":\"COLORE\",\"width\":100,\"align\":\"center\"}],\"cellEdited\":\"function(cell){var change = {idValue:cell.getRow().getIndex(),newValue:cell.getValue(),oldValue:cell.getOldValue(),field:cell.getColumn().getField()};this.send({topic:this.config.topic,ui_control:{callback:'cellEdited',changes:change}});}\",\"layout\":\"fitColumns\",\"movableColumns\":true,\"groupBy\":\"\"},\"customHeight\":12}",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 260,
        "y": 80,
        "wires": [
            [
                "038f4d061f1d7841"
            ]
        ]
    },
    {
        "id": "038f4d061f1d7841",
        "type": "ui_table",
        "z": "0bb94ab71fd44f0d",
        "group": "6ea6e760f5405df8",
        "name": "tabella",
        "order": 1,
        "width": "14",
        "height": "7",
        "columns": [],
        "outputs": 1,
        "cts": true,
        "x": 430,
        "y": 80,
        "wires": [
            [
                "ae5a0174dcce6cab"
            ]
        ]
    },
    {
        "id": "ae5a0174dcce6cab",
        "type": "function",
        "z": "0bb94ab71fd44f0d",
        "name": "function 33",
        "func": "let c = Object(msg.ui_control);\nlet ca = Object(c.changes)['idValue'];\nlet cb = parseFloat(Object(c.changes)['newValue']);\nlet cc = Object(c.changes)['oldValue'];\nlet cd = Object(c.changes)['field'];\n\n//var up = \"UPDATE TEST SET AGE = \" + cb + \" WHERE ID = \" + ca + \";\";\n//msg.topic = up;\nmsg.payload = {\n id: ca,\n newV: cb,\n oldV: cc,\n campo: cd,\n };\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 590,
        "y": 80,
        "wires": [
            [
                "6074bc525273faa0"
            ]
        ]
    },
    {
        "id": "6074bc525273faa0",
        "type": "debug",
        "z": "0bb94ab71fd44f0d",
        "name": "debug 92",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 760,
        "y": 80,
        "wires": []
    },
    {
        "id": "6ea6e760f5405df8",
        "type": "ui_group",
        "name": "Default",
        "tab": "63c69e4a2cbdd7f6",
        "order": 1,
        "disp": true,
        "width": 20,
        "collapse": false,
        "className": ""
    },
    {
        "id": "63c69e4a2cbdd7f6",
        "type": "ui_tab",
        "name": "Home",
        "icon": "Dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

```

![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/a/fa2adb22dd9bbc2e3e4fcad8132056d311a1195f.png)  
 ![2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/f/1f2d1c1556508718e03d2d8c6b56756a0c051212.png)

---

<div class="post-metadata">

**Author:** ![gennaro](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gennaro](https://discourse.nodered.org/u/gennaro)\
**Post date:** [24 February 2023 12:28 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/9 "2023-02-24T12:28:11Z")

</div>

Hi, I did further tests and I saw if I insert a join node between the function node and the debug node the result of the debug node is correct. Is it correct to do this?

 ![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/3/b38a1a2c5691ede29c12873d2162f68c54bcccbc.png)

```auto
[
    {
        "id": "0bb94ab71fd44f0d",
        "type": "tab",
        "label": "Flow 6",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "e767dc20f61a4278",
        "type": "inject",
        "z": "0bb94ab71fd44f0d",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[{\"id\":1,\"DATA\":\"12-09-1983\",\"NAME\":\"Kazuhito Yokoi\",\"AGE\":50,\"COLORE\":\"red\"},{\"id\":2,\"DATA\":\"12-08-2017\",\"NAME\":\"Oli Bob\",\"AGE\":12,\"COLORE\":\"cyan\"}]",
        "payloadType": "json",
        "x": 90,
        "y": 80,
        "wires": [
            [
                "f3706a2d57441c86"
            ]
        ]
    },
    {
        "id": "f3706a2d57441c86",
        "type": "change",
        "z": "0bb94ab71fd44f0d",
        "name": "ui_control",
        "rules": [
            {
                "t": "set",
                "p": "ui_control",
                "pt": "msg",
                "to": "{\"tabulator\":{\"columnResized\":\"function(column){var newColumn = { field: column._column.field, visible: column._column.visible, width: column._column.width, widthFixed: column._column.widthFixed, widthStyled: column._column.widthStyled }; this.send({topic:this.config.topic,ui_control:{callback:'columnResized',columnWidths:newColumn}}); }\",\"columnMoved\":\"function(column, columns){ var newColumns=[]; columns.forEach(function (column) { newColumns.push({'field': column._column.field}); }); this.send({topic:this.config.topic,ui_control:{callback:'columnMoved',columns:newColumns}}); }\",\"groupHeader\":\"function (value, count, data, group) {return value + \\\"<span style='color:#d00; margin-left:10px;'>(\\\" + count + \\\" Termostat\\\"+((count>1) ? \\\"e\\\" : \\\"\\\") + \\\")</span>\\\";}\",\"columns\":[{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Id\",\"field\":\"id\",\"width\":100,\"align\":\"center\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Data\",\"field\":\"DATA\",\"width\":100,\"align\":\"center\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Nome\",\"field\":\"NAME\",\"width\":100,\"align\":\"center\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Anni\",\"field\":\"AGE\",\"width\":100,\"editor\":\"input\",\"topCalc\":\"sum\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Colore\",\"field\":\"COLORE\",\"width\":100,\"align\":\"center\"}],\"cellEdited\":\"function(cell){var change = {idValue:cell.getRow().getIndex(),newValue:cell.getValue(),oldValue:cell.getOldValue(),field:cell.getColumn().getField()};this.send({topic:this.config.topic,ui_control:{callback:'cellEdited',changes:change}});}\",\"layout\":\"fitColumns\",\"movableColumns\":true,\"groupBy\":\"\"},\"customHeight\":12}",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 260,
        "y": 80,
        "wires": [
            [
                "038f4d061f1d7841"
            ]
        ]
    },
    {
        "id": "038f4d061f1d7841",
        "type": "ui_table",
        "z": "0bb94ab71fd44f0d",
        "group": "6ea6e760f5405df8",
        "name": "tabella",
        "order": 1,
        "width": "14",
        "height": "7",
        "columns": [],
        "outputs": 1,
        "cts": true,
        "x": 430,
        "y": 80,
        "wires": [
            [
                "ae5a0174dcce6cab"
            ]
        ]
    },
    {
        "id": "ae5a0174dcce6cab",
        "type": "function",
        "z": "0bb94ab71fd44f0d",
        "name": "function 33",
        "func": "let c = Object(msg.ui_control);\nlet ca = Object(c.changes)['idValue'];\nlet cb = parseFloat(Object(c.changes)['newValue']);\nlet cc = Object(c.changes)['oldValue'];\nlet cd = Object(c.changes)['field'];\n\n//var up = \"UPDATE TEST SET AGE = \" + cb + \" WHERE ID = \" + ca + \";\";\n//msg.topic = up;\nmsg.payload = {\n id: ca,\n newV: cb,\n oldV: cc,\n campo: cd,\n };\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 430,
        "y": 180,
        "wires": [
            [
                "7a4f5f48590e2928"
            ]
        ]
    },
    {
        "id": "6074bc525273faa0",
        "type": "debug",
        "z": "0bb94ab71fd44f0d",
        "name": "debug 92",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 780,
        "y": 180,
        "wires": []
    },
    {
        "id": "7a4f5f48590e2928",
        "type": "join",
        "z": "0bb94ab71fd44f0d",
        "name": "",
        "mode": "custom",
        "build": "array",
        "property": "ui_control",
        "propertyType": "msg",
        "key": "payload",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "1",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 610,
        "y": 180,
        "wires": [
            [
                "6074bc525273faa0"
            ]
        ]
    },
    {
        "id": "6ea6e760f5405df8",
        "type": "ui_group",
        "name": "Default",
        "tab": "63c69e4a2cbdd7f6",
        "order": 1,
        "disp": true,
        "width": 20,
        "collapse": false,
        "className": ""
    },
    {
        "id": "63c69e4a2cbdd7f6",
        "type": "ui_tab",
        "name": "Home",
        "icon": "Dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [24 February 2023 12:53 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/10 "2023-02-24T12:53:04Z")

</div>

If it works it works. I think if you add a debug node to the output of the ui-template you will see it returns multiple msg’s that are sent into the function node.

---

<div class="post-metadata">

**Author:** ![gennaro](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gennaro](https://discourse.nodered.org/u/gennaro)\
**Post date:** [24 February 2023 13:00 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/11 "2023-02-24T13:00:54Z")

</div>

in fact the table node returns an AGE : msg : Object and a msg : Object how can I make the table node return only the second msg? Thanks again

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [24 February 2023 14:40 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/12 "2023-02-24T14:40:36Z")

</div>

Ok, using your latest flow here is what I see is happening.

 ![Screenshot 2023-02-24 at 9.23.11 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d04cd660f656450b9957db0ae0698c8207ff8e25.png)  
When I click on the rows with 62 in the 'Anti' column, I get that row in the msg coming out of the ui-table node:

```auto
{
  "topic": "id",
  "payload": {
    "AGE": 62
  },
  "row": -1,
  "socketid": "75XHoIY-_jv20kavAAAL",
  "_msgid": "c65bd7be96ffd0bb"
}

```

if I click on the row with the Id of `2`, I get that row in the msg coming out of the ui-table node:

```auto
{
  "topic": "id",
  "payload": {
    "id": 2,
    "DATA": "12-08-2017",
    "NAME": "Oli Bob",
    "AGE": 12,
    "COLORE": "cyan"
  },
  "row": 1,
  "socketid": "75XHoIY-_jv20kavAAAL",
  "_msgid": "d6ace06c6a703eec"
}

```

The first line in your `function` node is

```auto
let c = Object(msg.ui_control);

```

but there is no `msg.ui_control` in the msgs coming from the `ui-table` node. and that causes issues in the rest of your function node.

I never see more than one msg coming out of the ui-table node. I honestly don't understand what you are trying to do in the function node.

What are you returning in the ui-table node? Please open the node and do a screen shot so I can see how you have configured it. The imported version has nothing in the 'Columns' section...maybe that is why I see a difference.

---

<div class="post-metadata">

**Author:** ![gennaro](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gennaro](https://discourse.nodered.org/u/gennaro)\
**Post date:** [24 February 2023 15:11 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/13 "2023-02-24T15:11:09Z")

</div>

I'm sorry but maybe I didn't tell you that the data in that column is editable try changing 50 to 51 and see the debug msg

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [25 February 2023 09:52 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/14 "2023-02-25T09:52:54Z")

</div>

Try adding this `switch` node between the `ui-table` and `function` nodes

```auto
[{"id":"ce1870b05fb7e47b","type":"switch","z":"5ab467fc5945cdc3","name":"","property":"ui_control.callback","propertyType":"msg","rules":[{"t":"eq","v":"cellEdited","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"_mcu":{"mcu":false},"x":430,"y":160,"wires":[["8589787f0f7a6675"],["927a1a415c2e9990"]]}]

```

It will test to see if msg.ui\_control.callback contains 'cellEdited' and will not pass the msg on if it doesn't have it.

---

<div class="post-metadata">

**Author:** ![gennaro](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gennaro](https://discourse.nodered.org/u/gennaro)\
**Post date:** [25 February 2023 11:06 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/15 "2023-02-25T11:06:47Z")

</div>

Hello, well with the switch node it's fine it filters only the msg that interests you and it makes more sense than the node I had put (join).  
Thanks for your support. Have a nice weekend  
 ![Cattura](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/9/2947822cd90e890e0444c6ab6f824096e6215559.png)

---

<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:** [11 March 2023 11:06 UTC](https://discourse.nodered.org/t/error-fetching-node-ui-table-data/75593/16 "2023-03-11T11:06:51Z")

</div>

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