Get data from ui table

While i found those two other posts apparently asking my same question, the answers given both involve strange work arounds and apparent confusion over the question or node they are using and are answering as if they are using the "ui-table-handler" node instead of just using the ui-table node like the questions asked. I was just hoping to get some clarification as to whether the ui-table node getData() command that is built into tabulator is broken or if it's not a 'command' in the same way that commands like 'download' are. The tabulator documentation says that "var data = table.getData("active"); //return currently filtered data" and i've used other tabulator commands (like the download one) in this manner successfully, im just not sure how to format this one or if it even 'works' the same way. Ways i've tried below...

msg.payload = {
"command": 'table.getData("active")'
}

msg.payload = {
command: '.getData("active")'
}

msg.payload = {
command: 'getData("active")'
}

msg.payload = {
"command": 'table.getData("")'
}

msg.payload = {
"command": "table.getData()"
}

msg.payload = {
"command": "table.getData"
}

msg.payload = {
"command": ".getData()"
}

msg.payload = {
"command": "getData()"
}

msg.payload = {
"command": "getData('active')"
}

msg.payload = {
"command": "getData"
}

Although I don't use the subflow, nor have any experience with it. Reading the mentioned topics, this seems to be the correct way:

msg.payload = { "command": "getData" }

The output comes from the secondary port on the node. Did you connect a debug node on that one ?

"...as if they are using the "ui-table-handler" node instead of just using the ui-table node like the questions asked."

Thanks for your time but you appear to be talking about the 'ui-table-handler' node since the ui-table node does not have a secondary port.

I ended up doing it a different way since i couldn't figure out how to send the command correctly. I added the below code to the ui_control.tabulator ...object?. Anyway it appears to be doing what i want it to, sending back all the data shown in the table after it's been filtered. Thought i'd leave this here in case it is helpful to anyone else trying to do the same.

"dataFiltered":"function(filters, rows){let data = []; for(i=0; i<rows.length; i++){data.push(rows[i].getData())}; this.send({ui_control:{callback:'dataFiltered'}, payload:data});}" ,
"movableColumns": true  //just showing that it's in the same place this one goes
1 Like

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