# Help linking Power table Cell to an external file

**URL:** <https://forum.inductiveautomation.com/t/help-linking-power-table-cell-to-an-external-file/99660>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [December 10, 2024, 8:43pm UTC](https://forum.inductiveautomation.com/t/help-linking-power-table-cell-to-an-external-file/99660 "2024-12-10T20:43:11Z")\
**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:** [December 10, 2024, 8:43pm UTC](https://forum.inductiveautomation.com/t/help-linking-power-table-cell-to-an-external-file/99660/1 "2024-12-10T20:43:11Z")

</div>

I wanted to bounce ideas off you guys and I don't know if there is way to do this in ignition but I have a script that opens certain files from a folder if clicked on a cell, but the postfix of the folder is in format \_XXXXXXX. My problem is I have no way of knowing the postfix, the closest way I can separate the folders is the "Date Modified" filter in Windows file explorer which corresponds to a DAte/Time column I have in power table.

In short there are two rows in power table with seria number a, but I want to open files from the first folder from cells in one row and files from the second folder from cells in the other row. And I have info about the date and time to when each folder was created in the power table.

Any help or suggestion is appreciated. Thanks.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/e/3e8c754456c700c534cb03bef80fdcd3f97bb396.png)

```python
	import os
	import system
	if colName not in ["Serial Number", "Result"]:  
	        return
	
	serial = self.data.getValueAt(rowIndex, self.data.getColumnIndex("Serial Number"))
	location = self.data.getValueAt(rowIndex, self.data.getColumnIndex("Test Stand"))
	folder_path = "A:\\Result\\M54\\Test\\AT\\" + location + "\\" + serial + "\\" + serial + "_XXXXXXXX"
	
	# Function to find the first file in the specified folder
	
	ext = ""
	if colName == "Serial Number":
		ext = ".html"
	elif colName == "Result":
		ext = ".txt"
	
	
	def find_file(folder_path, ext):
		for file_name in os.listdir(folder_path):
	 	    if file_name.endswith(ext):
		        return os.path.join(folder_path, file_name)
		return None
	# Find the HTML file
	file_path = find_file(folder_path, ext)
	
	
   	print("File path:", file_path)
   	
   	# Open the file using system.net.openURL
	if file_path:
	 	try:
	  	    system.net.openURL("file:///" + file_path.replace("\\", "/"))
	 	except Exception as e:
	  	    system.gui.errorBox("Failed to open file: {}".format(str(e)))
	else:
	 	system.gui.warningBox("No file found in the specified folder.")

```

---

<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:** [December 10, 2024, 8:57pm UTC](https://forum.inductiveautomation.com/t/help-linking-power-table-cell-to-an-external-file/99660/2 "2024-12-10T20:57:23Z")

</div>

Duplicate of this post:

> [@Linking Power table Cell to an external file](https://forum.inductiveautomation.com/t/linking-power-table-cell-to-an-external-file/99500):
>
> I wanted to bounce ideas off you guys and I don't know if there is way to do this in ignition but I have a script that opens certain files from a folder if clicked on a cell, but the postfix of the folder is in format \_XXXXXXX. My problem is I have no way of knowing the postfix, the closest way I can separate the folders is the "Date Modified" filter in Windows file explorer which corresponds to a DAte/Time column I have in power table. In short there are two rows in power table with seria numb…

Duplicate posts are against [this forum's rules](https://forum.inductiveautomation.com/faq). If you don't get a reply after a few days, a new comment added to a topic is the appropriate way to get fresh eyeballs.

---

<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:** [December 10, 2024, 8:57pm UTC](https://forum.inductiveautomation.com/t/help-linking-power-table-cell-to-an-external-file/99660/3 "2024-12-10T20:57:30Z")

</div>

Closed on December 10, 2024, 8:57pm UTC


