# Ui-table Dashboard 2.0 row number not returned

**URL:** <https://discourse.nodered.org/t/ui-table-dashboard-2-0-row-number-not-returned/96017>\
**Category:** Dashboard\
**Created:** [15 March 2025 10:44 UTC](https://discourse.nodered.org/t/ui-table-dashboard-2-0-row-number-not-returned/96017 "2025-03-15T10:44:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris378](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@Chris378](https://discourse.nodered.org/u/Chris378)\
**Post date:** [15 March 2025 10:44 UTC](https://discourse.nodered.org/t/ui-table-dashboard-2-0-row-number-not-returned/96017/1 "2025-03-15T10:44:30Z")

</div>

Dear Community

I`m using ui-table of Dashboard 2.0. There I have a table and I want to find out which row was clicked. This should be possible according the description, because it`s written the full row object is emitted. But that`s not true, the column specified as "Row Number" is not part of the object. Doing I`m something wrong or what is needed to get the row number, otherwise  
it`s impossible to know which row was clicked.

Thanks  
Chris

---

<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:** [15 March 2025 10:57 UTC](https://discourse.nodered.org/t/ui-table-dashboard-2-0-row-number-not-returned/96017/2 "2025-03-15T10:57:24Z")

</div>

> [@Chris378](#):
>
> it`s impossible to know which row was clicked.

No it is not. If you give your table data an unique ID (or row number), then that would be returned, you do not need to display it. You would need to track/store this so you can append data.

Or you can search the data array for the id.

e.g.

```auto
[{"id":"fcd9ceaf8abf44e4","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"id\":1,\"test\":\"one\"},{\"id\":2,\"test\":\"two\"}]","payloadType":"json","x":210,"y":5680,"wires":[["7f4163ee549d9273"]]},{"id":"7f4163ee549d9273","type":"ui-table","z":"d1395164b4eec73e","group":"9d83cd8b3d5ee33c","name":"","label":"","order":1,"width":0,"height":0,"maxrows":0,"passthru":false,"autocols":false,"showSearch":true,"selectionType":"click","columns":[{"title":"","key":"test","keyType":"key","type":"text","width":"","align":"start"}],"mobileBreakpoint":"sm","mobileBreakpointType":"defaults","action":"replace","x":410,"y":5660,"wires":[["71dcd6fef6b08225"]]},{"id":"71dcd6fef6b08225","type":"debug","z":"d1395164b4eec73e","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":580,"y":5660,"wires":[]},{"id":"9d83cd8b3d5ee33c","type":"ui-group","name":"Group1","page":"c694d0ebe0d2b702","width":"6","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"c694d0ebe0d2b702","type":"ui-page","name":"Page1","ui":"1805777f90e92057","path":"/page1","icon":"home","layout":"grid","theme":"a965ccfef139317a","breakpoints":[{"name":"Default","px":0,"cols":3},{"name":"Tablet","px":576,"cols":6},{"name":"Small Desktop","px":768,"cols":9},{"name":"Desktop","px":1024,"cols":12}],"order":1,"className":"","visible":true,"disabled":false},{"id":"1805777f90e92057","type":"ui-base","name":"dashboard ","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"titleBarStyle":"default","showReconnectNotification":false,"notificationDisplayTime":"5","showDisconnectNotification":false},{"id":"a965ccfef139317a","type":"ui-theme","name":"HN Theme","colors":{"surface":"#5c5c5c","primary":"#00fdff","bgPage":"#383838","groupBg":"#4f4f4f","groupOutline":"#858585"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

```

---

<div class="post-metadata">

**Author:** ![Chris378](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@Chris378](https://discourse.nodered.org/u/Chris378)\
**Post date:** [15 March 2025 11:53 UTC](https://discourse.nodered.org/t/ui-table-dashboard-2-0-row-number-not-returned/96017/3 "2025-03-15T11:53:20Z")

</div>

Hello

Yes, of course if I give it to the rows.  
I meant it's impossible from given data, even if there is a row number column.

---

<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:** [15 March 2025 12:18 UTC](https://discourse.nodered.org/t/ui-table-dashboard-2-0-row-number-not-returned/96017/4 "2025-03-15T12:18:58Z")

</div>

> [@Chris378](#):
>
> meant it's impossible from given data, even if there is a row number column.

It is not impossible.

As said you can search for the index.  
e.g

```auto
[{"id":"fcd9ceaf8abf44e4","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"id\":1,\"test\":\"one\"},{\"id\":2,\"test\":\"two\"}]","payloadType":"json","x":210,"y":5680,"wires":[["31850bca664e6129"]]},{"id":"31850bca664e6129","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"table_data","pt":"flow","to":"payload","tot":"msg","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":5640,"wires":[["7f4163ee549d9273"]]},{"id":"7f4163ee549d9273","type":"ui-table","z":"d1395164b4eec73e","group":"9d83cd8b3d5ee33c","name":"","label":"","order":1,"width":0,"height":0,"maxrows":0,"passthru":false,"autocols":false,"showSearch":true,"selectionType":"click","columns":[{"title":"","key":"test","keyType":"key","type":"text","width":"","align":"start"}],"mobileBreakpoint":"sm","mobileBreakpointType":"defaults","action":"replace","x":410,"y":5660,"wires":[["1f3fe7ccad345bc7"]]},{"id":"1f3fe7ccad345bc7","type":"function","z":"d1395164b4eec73e","name":"function 1","func":"const table_data = flow.get(\"table_data\") ?? [];\nmsg.index = table_data.findIndex(item => item.id === msg.payload.id);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":5660,"wires":[["71dcd6fef6b08225"]]},{"id":"71dcd6fef6b08225","type":"debug","z":"d1395164b4eec73e","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":780,"y":5660,"wires":[]},{"id":"9d83cd8b3d5ee33c","type":"ui-group","name":"Group1","page":"c694d0ebe0d2b702","width":"6","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"c694d0ebe0d2b702","type":"ui-page","name":"Page1","ui":"1805777f90e92057","path":"/page1","icon":"home","layout":"grid","theme":"a965ccfef139317a","breakpoints":[{"name":"Default","px":0,"cols":3},{"name":"Tablet","px":576,"cols":6},{"name":"Small Desktop","px":768,"cols":9},{"name":"Desktop","px":1024,"cols":12}],"order":1,"className":"","visible":true,"disabled":false},{"id":"1805777f90e92057","type":"ui-base","name":"dashboard ","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"titleBarStyle":"default","showReconnectNotification":false,"notificationDisplayTime":"5","showDisconnectNotification":false},{"id":"a965ccfef139317a","type":"ui-theme","name":"HN Theme","colors":{"surface":"#5c5c5c","primary":"#00fdff","bgPage":"#383838","groupBg":"#4f4f4f","groupOutline":"#858585"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

```

If you store you data as an object, with the row id as the name the search would be easier. and very simple to convert to array for the table data.  
e.g

```auto
[{"id":"652ed9d09e2e4642","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":5620,"wires":[["82f2e7efa09392b4"]]},{"id":"82f2e7efa09392b4","type":"function","z":"d1395164b4eec73e","name":"function 2","func":"msg.payload = Object.values(flow.get(\"table_data\")) ?? [];\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":260,"y":5620,"wires":[["7f4163ee549d9273"]]},{"id":"7f4163ee549d9273","type":"ui-table","z":"d1395164b4eec73e","group":"9d83cd8b3d5ee33c","name":"","label":"","order":1,"width":0,"height":0,"maxrows":0,"passthru":false,"autocols":false,"showSearch":true,"selectionType":"click","columns":[{"title":"","key":"test","keyType":"key","type":"text","width":"","align":"start"}],"mobileBreakpoint":"sm","mobileBreakpointType":"defaults","action":"replace","x":410,"y":5620,"wires":[["4cefb78652b86a57"]]},{"id":"4cefb78652b86a57","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"id","pt":"msg","to":"table_data[msg.payload.id].id","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":5620,"wires":[["71dcd6fef6b08225"]]},{"id":"71dcd6fef6b08225","type":"debug","z":"d1395164b4eec73e","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":780,"y":5620,"wires":[]},{"id":"fcd9ceaf8abf44e4","type":"inject","z":"d1395164b4eec73e","name":"initialise data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"1\":{\"id\":1,\"test\":\"one\"},\"2\":{\"id\":2,\"test\":\"two\"}}","payloadType":"json","x":210,"y":5560,"wires":[["31850bca664e6129"]]},{"id":"31850bca664e6129","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"table_data","pt":"flow","to":"payload","tot":"msg","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":5560,"wires":[[]]},{"id":"9d83cd8b3d5ee33c","type":"ui-group","name":"Group1","page":"c694d0ebe0d2b702","width":"6","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"c694d0ebe0d2b702","type":"ui-page","name":"Page1","ui":"1805777f90e92057","path":"/page1","icon":"home","layout":"grid","theme":"a965ccfef139317a","breakpoints":[{"name":"Default","px":0,"cols":3},{"name":"Tablet","px":576,"cols":6},{"name":"Small Desktop","px":768,"cols":9},{"name":"Desktop","px":1024,"cols":12}],"order":1,"className":"","visible":true,"disabled":false},{"id":"1805777f90e92057","type":"ui-base","name":"dashboard ","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"titleBarStyle":"default","showReconnectNotification":false,"notificationDisplayTime":"5","showDisconnectNotification":false},{"id":"a965ccfef139317a","type":"ui-theme","name":"HN Theme","colors":{"surface":"#5c5c5c","primary":"#00fdff","bgPage":"#383838","groupBg":"#4f4f4f","groupOutline":"#858585"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

```

---

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [15 March 2025 16:59 UTC](https://discourse.nodered.org/t/ui-table-dashboard-2-0-row-number-not-returned/96017/5 "2025-03-15T16:59:29Z")

</div>

You also have the option to use `@omrid01/node-red-dashboard-2-table-tabulator`, which enables to register for wide range of click & double-click notifications, sent with associated table/row/cell data

---

<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:** [1 April 2025 12:28 UTC](https://discourse.nodered.org/t/ui-table-dashboard-2-0-row-number-not-returned/96017/6 "2025-04-01T12:28:19Z")

</div>

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