# Set Selected Row for Power Table on Window Opening

**URL:** <https://forum.inductiveautomation.com/t/set-selected-row-for-power-table-on-window-opening/14693>\
**Category:** Ignition\
**Created:** [July 5, 2017, 7:19pm UTC](https://forum.inductiveautomation.com/t/set-selected-row-for-power-table-on-window-opening/14693 "2017-07-05T19:19:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dws2384](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@dws2384](https://forum.inductiveautomation.com/u/dws2384)\
**Post date:** [July 5, 2017, 7:19pm UTC](https://forum.inductiveautomation.com/t/set-selected-row-for-power-table-on-window-opening/14693/1 "2017-07-05T19:19:42Z")

</div>

Can’t seem to get this working. Using the initialize extension in the table properties all I want to do is set the selected row to 1 when the window opens. I’m assuming this has to be pretty simple have tried

table.selectedRow = 1  
table.setSelectedRow(1)

What am I missing here? Neither is working

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [July 5, 2017, 8:49pm UTC](https://forum.inductiveautomation.com/t/set-selected-row-for-power-table-on-window-opening/14693/2 "2017-07-05T20:49:19Z")

</div>

If you are using a Power Table Initialize extension script, the proper syntax would be:

```auto
self.selectedRow = 1

```

I have tested this and cannot get it working either.  
I also tried setting the selectedRow via the window internalFrame event scripts and visionWindow event scripts but not working there either.  
The row was changed momentarily, but was promptly de-selected. Maybe there is some other thing overwriting it?  
Perhaps a bug with the component. Hopefully someone can pitch in.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 5, 2017, 9:08pm UTC](https://forum.inductiveautomation.com/t/set-selected-row-for-power-table-on-window-opening/14693/3 "2017-07-05T21:08:53Z")

</div>

IA doesn’t document the order of initialization events and custom methods with respect to each other and the propertyChange events that can result. Assigning the dataset to the component generally produces a pair of assignments to selectedRow attempting to maintain the previously selected row. Your best bet is to wrap your assignment in an invokeLater() operation, so it happens after any already-queued events.

---

<div class="post-metadata">

**Author:** ![dws2384](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@dws2384](https://forum.inductiveautomation.com/u/dws2384)\
**Post date:** [July 6, 2017, 1:29pm UTC](https://forum.inductiveautomation.com/t/set-selected-row-for-power-table-on-window-opening/14693/4 "2017-07-06T13:29:10Z")

</div>

Thanks for the response…are you able to clarify this more?

Thanks

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 6, 2017, 2:32pm UTC](https://forum.inductiveautomation.com/t/set-selected-row-for-power-table-on-window-opening/14693/5 "2017-07-06T14:32:02Z")

</div>

Here’s some older posts that might help you out:

- [invokeAsynchronous Paramenters](http://forum.inductiveautomation.com/t/invokeasynchronous-paramenters/11186)
- [Progress Bar not Progressing in Client](http://forum.inductiveautomation.com/t/progress-bar-not-progressing-in-client/12669)
- [Template output parameters](http://forum.inductiveautomation.com/t/template-output-parameters/10601)

---

<div class="post-metadata">

**Author:** ![coster](https://avatars.discourse-cdn.com/v4/letter/c/57b2e6/32.png) [@coster](https://forum.inductiveautomation.com/u/coster)\
**Post date:** [September 11, 2020, 10:34am UTC](https://forum.inductiveautomation.com/t/set-selected-row-for-power-table-on-window-opening/14693/6 "2020-09-11T10:34:14Z")

</div>

Answer on this topic here:

> [@Selecting multiple vision table rows from python?](http://forum.inductiveautomation.com/t/selecting-multiple-vision-table-rows-from-python/26331):
>
> I’m not able to select multiple rows in a vision table using python. The selection mode in the table is set to “multiple interval”, however the following code always selects a single line (the last), instead of lines 0, 2, 4 etc.: for row in range(0, mytable.data.getRowCount(), 2): mytable.setRowSelectionInterval(row, row) As far as I can tell there’s no setSelectedRows() function or similar. Am I missing something?
