# \[BUG-14211,14523\] Problem with SelectedRows array

**URL:** <https://forum.inductiveautomation.com/t/bug-14211-14523-problem-with-selectedrows-array/25799>\
**Category:** Ignition\
**Created:** [June 13, 2019, 2:20pm UTC](https://forum.inductiveautomation.com/t/bug-14211-14523-problem-with-selectedrows-array/25799 "2019-06-13T14:20:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![grisbel.molina](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@grisbel.molina](https://forum.inductiveautomation.com/u/grisbel.molina)\
**Post date:** [June 13, 2019, 2:20pm UTC](https://forum.inductiveautomation.com/t/bug-14211-14523-problem-with-selectedrows-array/25799/1 "2019-06-13T14:20:06Z")

</div>

Hi to all.

I am trying to use “getSelectedRows()” in “onMousePress” extension function to get the row indexes of the selected rows in a power table. It used to work just fine in the last version of Ignition, but now, in version 8, it works like this:

As you can see, i have selected 5 rows (and i print the array each time i select a row).  
The first time i select a row, i get the “array (‘i’)” and not the value; it starts saving the first row index the second time i select a row, and it doesnt save the last row index.  
what is the problem here?, i have used this many times and always worked.

---

<div class="post-metadata">

**Author:** ![grisbel.molina](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@grisbel.molina](https://forum.inductiveautomation.com/u/grisbel.molina)\
**Post date:** [June 13, 2019, 2:21pm UTC](https://forum.inductiveautomation.com/t/bug-14211-14523-problem-with-selectedrows-array/25799/2 "2019-06-13T14:21:18Z")

</div>

![imagen](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e5136514fe870ffc570c981d52e15fde8a50ad3c.png)

---

<div class="post-metadata">

**Author:** ![Michael.Stofan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.stofan/32/3342_2.png) [@Michael.Stofan](https://forum.inductiveautomation.com/u/Michael.Stofan)\
**Post date:** [June 17, 2019, 11:25pm UTC](https://forum.inductiveautomation.com/t/bug-14211-14523-problem-with-selectedrows-array/25799/3 "2019-06-17T23:25:26Z")

</div>

Thanks for reporting this, I’m able to replicate the issue here. I’ll make a ticket so we can figure out what’s going on. For reference it’s case #14211

---

<div class="post-metadata">

**Author:** ![grisbel.molina](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@grisbel.molina](https://forum.inductiveautomation.com/u/grisbel.molina)\
**Post date:** [June 28, 2019, 11:06am UTC](https://forum.inductiveautomation.com/t/bug-14211-14523-problem-with-selectedrows-array/25799/4 "2019-06-28T11:06:03Z")

</div>

Super!.Thanks

---

<div class="post-metadata">

**Author:** ![mhickerson](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@mhickerson](https://forum.inductiveautomation.com/u/mhickerson)\
**Post date:** [July 19, 2019, 10:47pm UTC](https://forum.inductiveautomation.com/t/bug-14211-14523-problem-with-selectedrows-array/25799/5 "2019-07-19T22:47:14Z")

</div>

I’m seeing the same behavior in 7.9.11; this is happening because the event is onMousePressed, which is fired before your newest selection has been made. You’ll always be one step behind, which is why you don’t have a selection in the first print statement.

Please message me directly if you’re using a script that had worked in an older version and are having issues with it in 8.0.

Thanks
