# Perspective Table - Selected Rows

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-selected-rows/37316>\
**Category:** Ignition\
**Created:** [August 3, 2020, 2:36pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selected-rows/37316 "2020-08-03T14:36:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![djones](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@djones](https://forum.inductiveautomation.com/u/djones)\
**Post date:** [August 3, 2020, 2:36pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selected-rows/37316/1 "2020-08-03T14:36:49Z")

</div>

I have a table where I would like to update many cells at the same time.

If I have props.selection.enableRowSelection and .enableColumn selection enabled. I get a dataset .props.selection.data that contains just the column name and cell value as a dictionary. I have no way to identify the row for those cells and get back the id value for that row.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 3, 2020, 3:19pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selected-rows/37316/2 "2020-08-03T15:19:35Z")

</div>

If you need that data you should be using the `onSelectionChange` Event for the component.

```auto
    Fired when the table selection has changed.

	Arguments:
		self: A reference to the component that is invoking this function.
		event: An object with the following attributes:
			data (list): The current selection data.
			selectedColumn (str | int | None): The current selected column.
			selectedRow (int | None): The current selected row. Can be an
			                          integer, or null. The unique row index as it is represented in the
			                          source data. Also known as the row ID.

```

---

<div class="post-metadata">

**Author:** ![djones](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@djones](https://forum.inductiveautomation.com/u/djones)\
**Post date:** [August 3, 2020, 5:21pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selected-rows/37316/3 "2020-08-03T17:21:40Z")

</div>

When I detect a tab press, and change the selectedcolumn. The row cell being edited does not change. I still see the editor for C4 but the selected row is C5.

---

<div class="post-metadata">

**Author:** ![Brandon\_Peterson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brandon_peterson/32/32960_2.png) [@Brandon\_Peterson](https://forum.inductiveautomation.com/u/Brandon_Peterson)\
**Post date:** [May 27, 2022, 5:09pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selected-rows/37316/4 "2022-05-27T17:09:42Z")

</div>

_Considering the number of views this question has gotten while remaining unsolved, I figured it was worth a reply. I hope it helps!_

A workaround that I’ve used for a similar issue is to add a `rowId` column to the data itself. You’ll have to configure the table to hide that column using the `myTable.props.columns` array, but that’s pretty easy to do. Then, when you use the `props.selection.data` property, you’ll have access to which rows were selected relative to the underlying dataset.

_Sidenote:_ In Vision, there’s a hidden `selectedRows` property on the power table (you have to use the javadocs to find it), but I couldn’t find a similar hidden property for tables in Perspective. It’d be nice to see properties like these exposed and easy to use.
