Error fetching node ui-table data

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.

[
    {
        "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
    }
]

Continuing the discussion from Error fetching node ui-table data:
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.

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

Can you show the input to the function node?

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

[
    {
        "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
    }
]

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

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.

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

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.

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.

[
    {
        "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
2

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?

[
    {
        "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
    }
]

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.

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

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


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:

{
  "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:

{
  "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

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.

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

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

[{"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.

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

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