# Getting selected cell value in Power Table

**URL:** <https://forum.inductiveautomation.com/t/getting-selected-cell-value-in-power-table/98781>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [November 19, 2024, 2:26pm UTC](https://forum.inductiveautomation.com/t/getting-selected-cell-value-in-power-table/98781 "2024-11-19T14:26:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_C](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@S\_C](https://forum.inductiveautomation.com/u/S_C)\
**Post date:** [November 19, 2024, 2:26pm UTC](https://forum.inductiveautomation.com/t/getting-selected-cell-value-in-power-table/98781/1 "2024-11-19T14:26:53Z")

</div>

I am trying to get a value of the cell from a power table to put into a path to open a file, I have the script working if I put it into a Momentary button and get the value from a label, but when I put it into onMouseClick or onDoubleclick Function in Power table component scripting it doesn't work. I think Im not passing the value of the cell into the path.

```python
    serial = value
	
	folder_path = "A:\\Results\\MY\\Test\\X\\C\\" + serial + "\\" + serial + "_[20241118]"
	
	def find_html_file(folder_path):
		for file_name in os.listdir(folder_path):
	 	    if file_name.endswith(".html"):
		        return os.path.join(folder_path, file_name)
	return None
	
	# Find the HTML file
	html_file_path = find_html_file(folder_path)
	
	print("HTML file path:", html_file_path)
	
	# Open the HTML file using system.net.openURL
	if html_file_path:
	 	try:
	  	    system.net.openURL("file:///" + html_file_path.replace("\\", "/"))
	 	except Exception as e:
	  	    system.gui.errorBox("Failed to open HTML file: {}".format(str(e)))
	else:
	 	system.gui.warningBox("No HTML file found in the specified folder.")

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 19, 2024, 3:57pm UTC](https://forum.inductiveautomation.com/t/getting-selected-cell-value-in-power-table/98781/2 "2024-11-19T15:57:50Z")

</div>

> [@S\_C](#):
>
> ```python
> def find_html_file(folder_path):
> for file_name in os.listdir(folder_path):
> if file_name.endswith(".html"):
> return os.path.join(folder_path, file_name)
> return None
> 
> ```

You are unconditionally returning `None` at this line, unless you messed up the indentation when you pasted into the forum.

---

<div class="post-metadata">

**Author:** ![S\_C](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@S\_C](https://forum.inductiveautomation.com/u/S_C)\
**Post date:** [November 19, 2024, 4:05pm UTC](https://forum.inductiveautomation.com/t/getting-selected-cell-value-in-power-table/98781/3 "2024-11-19T16:05:58Z")

</div>

Yeah that solved it, I messed up the indentation while copying into the power table scripting window. Thank you.
