# Keeping the selected row in a powertable?

**URL:** <https://forum.inductiveautomation.com/t/keeping-the-selected-row-in-a-powertable/21751>\
**Category:** Ignition\
**Created:** [January 8, 2019, 8:55pm UTC](https://forum.inductiveautomation.com/t/keeping-the-selected-row-in-a-powertable/21751 "2019-01-08T20:55:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [January 8, 2019, 8:55pm UTC](https://forum.inductiveautomation.com/t/keeping-the-selected-row-in-a-powertable/21751/1 "2019-01-08T20:55:04Z")

</div>

I have a power table with data binded to an expression returning a source dataset.  
User can select only one row.  
When new data are added or dateted in the source dataset, I would like to keep the row selected by the user (in the case the row is still in the source dataset)  
each time a row is added in the source dataset, this row is selected bu default, and user row selection is lost.  
Any idea to achieve that ?

---

<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:** [January 8, 2019, 9:21pm UTC](https://forum.inductiveautomation.com/t/keeping-the-selected-row-in-a-powertable/21751/2 "2019-01-08T21:21:41Z")

</div>

I don’t fully understand what you are asking, but maybe you could add a custom property that points to the rowIndex that the user last selected. I guess you could put the script in onMousePress extension function. Something like

```auto
self.customProperty = rowIndex

```
