# Get tabledata from ui\_table through ui-table handler

**URL:** <https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310>\
**Category:** Dashboard\
**Created:** [16 February 2023 18:42 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310 "2023-02-16T18:42:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marchal-web](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marchal-web/32/66937_2.png) [@Marchal-web](https://discourse.nodered.org/u/Marchal-web)\
**Post date:** [16 February 2023 18:42 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/1 "2023-02-16T18:42:29Z")

</div>

I have tried to follow this discusion [Get data from ui\_table](https://discourse.nodered.org/t/get-data-from-ui-table/41440/5), to get an array from the ui-table

> [@Get data from ui\_table](https://discourse.nodered.org/t/get-data-from-ui-table/41440/5):
>
> a `msg.payload.command="getTable"` should give you the table array on the second output

But the handler reply this error when I send "getTable" to it:

> 16/02/2023 19:32:43[node: handle tableData](http://127.0.0.1:1880/#)function : (error)  
> "TypeError: Cannot set properties of undefined (setting 'tableArray')"

Any idea what going on ?

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [16 February 2023 19:21 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/2 "2023-02-16T19:21:13Z")

</div>

I use a version of @Christian-Me UI table handler, I say version as I think there may be more than one flow in circulation.

There is no command _ **msg.payload.command="getTable"** _ in the version I use.

So if you also have a similar version the command will not work.

However you should be able to get the table data from the context store.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [16 February 2023 20:11 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/3 "2023-02-16T20:11:52Z")

</div>

Works here, have you set the index for your table data index (my example id) property?

 ![chrome_screenshot_1676578112259](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a3bbbf23fc67091f974545db5269047f643e2a4b.png)  
 ![chrome_screenshot_1676578145609](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/b/9b38160cc828fdff3137e2ec99f479ef5e861a41.jpeg)

---

<div class="post-metadata">

**Author:** ![Marchal-web](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marchal-web/32/66937_2.png) [@Marchal-web](https://discourse.nodered.org/u/Marchal-web)\
**Post date:** [17 February 2023 07:31 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/4 "2023-02-17T07:31:30Z")

</div>

Thanks for your answers  
I had import the example from @Christian-Me to understand how it works:  
[https://raw.githubusercontent.com/Christian-Me/remote-device-table/master/table-handler-demo-01.json](https://raw.githubusercontent.com/Christian-Me/remote-device-table/master/table-handler-demo-01.json)

@Sean-McG in my version the command exist:

> if (command==="getTable") {  
> msg.payload.tableArray=;  
> tableArray=msg.payload.tableArray  
> }

@E1cid: I set the id as you did, same result.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/108d981eb4d557e13f39e114302b86405dcb5234.png)  
Could you pass me your simple example to check on my side ?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [17 February 2023 07:47 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/5 "2023-02-17T07:47:03Z")

</div>

To large to paste , here is a download  
[flows.json](https://discourse.nodered.org/uploads/short-url/hFqt6RNoZJY4vOjtLzHCSkA0C4Z.json) (42.7 KB)

---

<div class="post-metadata">

**Author:** ![Marchal-web](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marchal-web/32/66937_2.png) [@Marchal-web](https://discourse.nodered.org/u/Marchal-web)\
**Post date:** [17 February 2023 13:37 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/6 "2023-02-17T13:37:11Z")

</div>

Thanks you very mutch @E1cid , it seems to work on my side. I get the table from second connector. thanks.

But Since I had imported your flow, I have two ui-table handler available in the nodes list.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/26f8fdb9898c5d7c32346d6e580d6e994ef2d26e.png)

And both are differents, differents options.  
There is one that doesn't respond to the gettable and the other yes.

@E1cid with your flow I can't have event when a cell is changed from the ui (option "editor": "input").  
Also, in the array send by the gettable request, it haven't been update with the new modifications made from ui. it send the original table.  
if I modifiy the value of a cell, the handle doesn't take in account, It look like the the table node and the handler aren't linked, how I can set the handle to get table with modified values when I request a a gettable ?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [17 February 2023 16:34 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/7 "2023-02-17T16:34:27Z")

</div>

I did edit the handler I sent you, but just removed some syntax errors, functionality is as before.

How do you send updates from the ui, example please.

The table and handler are not link if you want to update the table you need to feed the update into the handler.

---

<div class="post-metadata">

**Author:** ![Marchal-web](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marchal-web/32/66937_2.png) [@Marchal-web](https://discourse.nodered.org/u/Marchal-web)\
**Post date:** [17 February 2023 17:26 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/8 "2023-02-17T17:26:20Z")

</div>

With the attached flows  
[flows.json](https://discourse.nodered.org/uploads/short-url/bY06ARvU9kmYaNl2HlcDgNPGUUI.json) (48.9 KB)  
You can modify temperature or voltage values from the ui. If I modify a cell there's no update on the table connector.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [17 February 2023 17:40 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/9 "2023-02-17T17:40:45Z")

</div>

Your table data has no index property which may be an issue.

I haven't used these nodes in a while but if i remember correctly you send

```auto
{
  payload : { 
    command:" "string",
    arguments: [[{row objectt}]]
  }
}

```

---

<div class="post-metadata">

**Author:** ![Marchal-web](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marchal-web/32/66937_2.png) [@Marchal-web](https://discourse.nodered.org/u/Marchal-web)\
**Post date:** [20 February 2023 08:07 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/10 "2023-02-20T08:07:18Z")

</div>

Sorry the example was wrong, I modified it with the index.  
[flows.json](https://discourse.nodered.org/uploads/short-url/n1asIqA2WIJ0dodNf3Y2tcfBd7e.json) (49.0 KB)  
Then in this exemple you can modify the cells from the ui.

---

<div class="post-metadata">

**Author:** ![Marchal-web](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marchal-web/32/66937_2.png) [@Marchal-web](https://discourse.nodered.org/u/Marchal-web)\
**Post date:** [21 February 2023 06:53 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/11 "2023-02-21T06:53:25Z")

</div>

Nothing come out the output connector of the table node ("send data on click" is enable). Do you know how I can set this table node to get modified value on output connector when one or several cells are modified from the ui ?

---

<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:** [23 March 2023 06:53 UTC](https://discourse.nodered.org/t/get-tabledata-from-ui-table-through-ui-table-handler/75310/12 "2023-03-23T06:53:31Z")

</div>

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