# table.getSelectedRowCount()

**URL:** <https://forum.inductiveautomation.com/t/table-getselectedrowcount/60693>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [June 13, 2022, 3:56pm UTC](https://forum.inductiveautomation.com/t/table-getselectedrowcount/60693 "2022-06-13T15:56:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aybars.Urut](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/aybars.urut/32/32003_2.png) [@Aybars.Urut](https://forum.inductiveautomation.com/u/Aybars.Urut)\
**Post date:** [June 13, 2022, 3:56pm UTC](https://forum.inductiveautomation.com/t/table-getselectedrowcount/60693/1 "2022-06-13T15:56:15Z")

</div>

Hi all,

Sorry for this dummy question, but…

I checked everywhere and, when I want to get selected row number, I can use `.getSelectedRowCount()`.

Please, could someone tell me whats wrong here?  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/2/022b9f8920b3efb16993bcd7f89e5bedbbeb1ee7.png)

Im using this script in the button and Im getting this error;

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/75897820def6abf41009a680c53ce94b114431b8.png)

If the problem at command, please correct me with correct one.

Btw, I tried v8.1.9 and v8.1.12

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [June 13, 2022, 4:28pm UTC](https://forum.inductiveautomation.com/t/table-getselectedrowcount/60693/2 "2022-06-13T16:28:58Z")

</div>

Based on the error, it seems like `getSelectedRowCount` is being called on something other than a Table component. Are you certain the name of the table you’re trying to access is `Tbl_Employess`?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 13, 2022, 4:31pm UTC](https://forum.inductiveautomation.com/t/table-getselectedrowcount/60693/3 "2022-06-13T16:31:14Z")

</div>

For debugging, I’d recommend printing both the component you’re getting and it’s full type (literally just `print type(someVariable)`

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 13, 2022, 5:39pm UTC](https://forum.inductiveautomation.com/t/table-getselectedrowcount/60693/4 "2022-06-13T17:39:38Z")

</div>

A power table does not have the `getSelectedRowCount()` function, which is probably what you are using.

[Vision - Power Table - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/Vision+-+Power+Table)

For power tables, do this instead

```auto
a = len(event.source.parent.getComponent('Tbl_Employees').getSelectedRows())

```

Also, I just noticed a probable typo, you have `Tbl_Employess` instead of `Tbl_Employees`

---

<div class="post-metadata">

**Author:** ![Aybars.Urut](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/aybars.urut/32/32003_2.png) [@Aybars.Urut](https://forum.inductiveautomation.com/u/Aybars.Urut)\
**Post date:** [June 13, 2022, 6:13pm UTC](https://forum.inductiveautomation.com/t/table-getselectedrowcount/60693/5 "2022-06-13T18:13:23Z")

</div>

Ah, thank you. you’re right using power table and with len() its working 🤌

you caught me… even table real name is Employess, I noticed when you said…
