# getSelectedRows

**URL:** <https://forum.inductiveautomation.com/t/getselectedrows/54420>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [December 23, 2021, 3:24am UTC](https://forum.inductiveautomation.com/t/getselectedrows/54420 "2021-12-23T03:24:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnny\_Li1](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Johnny\_Li1](https://forum.inductiveautomation.com/u/Johnny_Li1)\
**Post date:** [December 23, 2021, 3:24am UTC](https://forum.inductiveautomation.com/t/getselectedrows/54420/1 "2021-12-23T03:24:19Z")

</div>

Hi guys  
I am just wondering how do you use getSelectedRows()? How to fix this issue ?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/3/535ae701b90b905e5ba0d24d5faf95ca6b18d341.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/e/ce4d1b8dd58de4e39711a02bde9e3c1d66fd6fe4.png)

many thanks  
Johnny

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [December 23, 2021, 3:59am UTC](https://forum.inductiveautomation.com/t/getselectedrows/54420/2 "2021-12-23T03:59:46Z")

</div>

See if this helps you,

> [@Get All Selected Cells in Power Table](https://forum.inductiveautomation.com/t/get-all-selected-cells-in-power-table/15934):
>
> I have a power table which allows the user to select only the cells they want to selected in each column rather than entire rows. I need to get a dictionary or a dataset containing all of the cell values or else the indices that can be used to find the values of the selected cells. I cannot find a way to get this information directly from the component or else add this functionality. If I need to add it, then I was thinking I could just add a tuple to a list in a custom property every time a n…

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [December 23, 2021, 4:27am UTC](https://forum.inductiveautomation.com/t/getselectedrows/54420/3 "2021-12-23T04:27:01Z")

</div>

No because that applies to Vision

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [December 23, 2021, 4:52am UTC](https://forum.inductiveautomation.com/t/getselectedrows/54420/4 "2021-12-23T04:52:09Z")

</div>

Sorry, didn’t look close enough to his post.

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [December 23, 2021, 4:52am UTC](https://forum.inductiveautomation.com/t/getselectedrows/54420/5 "2021-12-23T04:52:49Z")

</div>

The problem is in line 4, there is no attribute implemented _getSelectedRows()_ by default.

You should errase line 4 and iterate over `self.props.selection.data`, like this

```auto
for sd in self.props.selection.data:
     id = sd["ID"]

```

---

<div class="post-metadata">

**Author:** ![dustin.cooper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dustin.cooper/32/29963_2.png) [@dustin.cooper](https://forum.inductiveautomation.com/u/dustin.cooper)\
**Post date:** [December 23, 2021, 4:54am UTC](https://forum.inductiveautomation.com/t/getselectedrows/54420/6 "2021-12-23T04:54:21Z")

</div>

`getSelectedRows()`  
Is a function only on the vision table component.

For the perspective flavor, the selected data is a property. Try

```auto
rows = self.getSibling(‘Table’).props.selection.data

```

Also, keep in mind that this data will be formatted as a Python array of dict, not an ignition dataset, so you will have to access your ID value like `id = row[‘ID’]`
