# Power Table Row Select via mouse click

**URL:** <https://forum.inductiveautomation.com/t/power-table-row-select-via-mouse-click/115522>\
**Category:** Ignition\
**Tags:** vision, ignition81\
**Created:** [May 13, 2026, 9:02pm UTC](https://forum.inductiveautomation.com/t/power-table-row-select-via-mouse-click/115522 "2026-05-13T21:02:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [May 13, 2026, 9:02pm UTC](https://forum.inductiveautomation.com/t/power-table-row-select-via-mouse-click/115522/1 "2026-05-13T21:02:48Z")

</div>

How would I get a cell value from the Power Table on a row selection using a mouse?

I tried the `mouseClicked` event, but it fires after I click the row, then click on an empty section of the Power Table. So, now I am trying the `onMousePress` extension function, but it tells me that I cannot use:

```python
table = event.source
val = table.data.getValueAt(...)

```

because it has no attribute `data`.  
So then what? I have used this code on a normal Vision table...

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 13, 2026, 9:08pm UTC](https://forum.inductiveautomation.com/t/power-table-row-select-via-mouse-click/115522/2 "2026-05-13T21:08:50Z")

</div>

The `event` object is referring to the mouse event. There is a `value` object that references the value of the clicked upon location. If that doesn't work for what you are attempting then you can use `self.data`, according to the manual a reference to the component is passed as `self` to the event.

> **[onMousePress​ - Vision - Power Table Scripting Functions | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/vision-components/tables/power-table/power-table-scripting-functions#onmousepress)**
>
> This page details the various component and extension functions available for Vision's Power Table component.

> Object **value** - The value at the location clicked on.

> Component **self** - A reference to the component that is invoking this function.

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [May 13, 2026, 9:17pm UTC](https://forum.inductiveautomation.com/t/power-table-row-select-via-mouse-click/115522/3 "2026-05-13T21:17:51Z")

</div>

Thanks Ryan.  
Funny, I just figured out another way just as you replied, and combined the two here:

```python
def onMousePress(self, rowIndex, colIndex, colName, value, event):
	table = event.source
	recipe = table.getValueAt(rowIndex, 0)
	self.parent.selectedRecipe = recipe
	
	data = self.data
	val = data.getValueAt(self.selectedRow, 'RecipeID')
	print val

```

Interestingly, using `event.source` I must use an integer valued index, but using `self.data` I can use the column heading as well.

---

<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:** [May 13, 2026, 10:10pm UTC](https://forum.inductiveautomation.com/t/power-table-row-select-via-mouse-click/115522/4 "2026-05-13T22:10:41Z")

</div>

`event.source.getValueAt` is calling the method on the actual JTable:

> **[row - JTable (Java SE 21 & JDK 21)](https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/JTable.html#getValueAt(int,int))**
>
> Clears any existing columns before creating the new columns based on information from the model. | declaration: module: java.desktop, package: javax.swing, class: JTable

`data.getValueAt` is calling the method on `Dataset`, which is overloaded to accept column names as well:

> **[ArrayIndexOutOfBoundsException - Dataset](https://sdk.inductiveautomation.com/javadoc/ignition83/8.3.6/com/inductiveautomation/ignition/common/Dataset.html#getValueAt(int,int))**
>
> Dataset provides an inefficient default implementation of binary search that allocates a new array list for the entire column. | declaration: package: com.inductiveautomation.ignition.common, interface: Dataset

Note that if you ever sort or filter the table data you'll have to account for that.
