# Number of selected rows in Perspective Table component?

**URL:** <https://forum.inductiveautomation.com/t/number-of-selected-rows-in-perspective-table-component/37140>\
**Category:** Ignition\
**Created:** [July 28, 2020, 2:07am UTC](https://forum.inductiveautomation.com/t/number-of-selected-rows-in-perspective-table-component/37140 "2020-07-28T02:07:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [July 28, 2020, 2:07am UTC](https://forum.inductiveautomation.com/t/number-of-selected-rows-in-perspective-table-component/37140/1 "2020-07-28T02:07:34Z")

</div>

I am trying to return the number of selected rows of a Perspective table component in a script. If I select more than one row, such that the “data” property has a length of grater than 1:

 ![ig_perpective_table_numselectedrows](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/6/f6863841aa6308e89cb07d8ecd727ffaebbcfbf5.jpeg)

then I use the “len” operator:

```
Names = [self.getSibling("Table_Ballot").props.selection.data]
logger = system.util.getLogger("myLogger")
logger.info(str(Names) + " len " + str(len(Names)))

```

it only returns a “len” of 1 no mater how many rows I have selected

log output with 1 selected:  
[: [: {u’Name’: u’Joan’}]] len 1

log output with 2 selected:  
[: [: {u’Name’: u’Dennis’}, : {u’Name’: u’Steve’}]] len 1

log output with 3 selected:  
[: [: {u’Name’: u’Steve’}, : {u’Name’: u’Dennis’}, : {u’Name’: u’Joan’}]] len 1

log output with 4 selected:  
[: [: {u’Name’: u’Steve’}, : {u’Name’: u’Fido’}, : {u’Name’: u’Dennis’}, : {u’Name’: u’Joan’}]] len 1

In all cases, “len” returned 1. Is there some other way of getting the number of selected rows?

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [July 28, 2020, 3:50am UTC](https://forum.inductiveautomation.com/t/number-of-selected-rows-in-perspective-table-component/37140/2 "2020-07-28T03:50:24Z")

</div>

Get rid of the outer brackets. You are putting the contents of data into a list.

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [July 29, 2020, 2:13am UTC](https://forum.inductiveautomation.com/t/number-of-selected-rows-in-perspective-table-component/37140/3 "2020-07-29T02:13:32Z")

</div>

Thanks, that did it. So the brackets copy the structure but without the brackets it copies the data?

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [July 29, 2020, 2:30am UTC](https://forum.inductiveautomation.com/t/number-of-selected-rows-in-perspective-table-component/37140/4 "2020-07-29T02:30:31Z")

</div>

No. In python, brackets = list.  
The data property is a list. You are putting a list inside a list. You have 1 item (data) in the list Names
