# Using the information of a Power Table in a label that is in another window

**URL:** <https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [October 11, 2023, 2:15pm UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339 "2023-10-11T14:15:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 11, 2023, 2:15pm UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/1 "2023-10-11T14:15:22Z")

</div>

hello,

I'm trying to get some string in my power table to be shown in a label in an other window than the power table itself. I found out about this [https://docs.inductiveautomation.com/display/DOC/Finding+Components+on+Other+Windows](https://docs.inductiveautomation.com/display/DOC/Finding+Components+on+Other+Windows)  
but this isn't working when I use the expression in a label.

---

<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:** [October 11, 2023, 2:18pm UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/2 "2023-10-11T14:18:25Z")

</div>

You cannot use an expression/property binding to do this. You need scripting. You need to handle the case when the other window is not open.

A better solution is to use Vision Client Tags as a client-wide persistent value, that you can count on whether a particular window is open or not.

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 11, 2023, 2:19pm UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/3 "2023-10-11T14:19:46Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/b/1b43d8396512321ca801c81b9b4169106d389fa0.png)  
this is my table for example in window 1  
and I want to use a parameter in window 2 that shows the text of the number that is being passed by the parameter.

---

<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:** [October 11, 2023, 2:21pm UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/4 "2023-10-11T14:21:12Z")

</div>

Are you opening window 2 from an action in window 1? If so, use a window parameter. (Window parameters are assigned to a root container custom property of the same name when the window opens. You can then bind your label to that custom property.)

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 11, 2023, 2:24pm UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/5 "2023-10-11T14:24:39Z")

</div>

No, I have a template with components that all use the parameter of the template. I made a different window where I import a CSV file with the text list that the label has to show. so if I give my template number 4 for example the label has to show the text at number 4.

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 11, 2023, 2:27pm UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/6 "2023-10-11T14:27:29Z")

</div>

So a text list is being imported into the power table so I can assign text to a certain value and then I can say in my label expression that if the parameter is 4 that label shows the text of number 4. This is easy when I have the label and power table in the same window but not if the label is being used in an other window.

---

<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:** [October 11, 2023, 2:29pm UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/7 "2023-10-11T14:29:07Z")

</div>

Sounds like you need to push the selection in window 1 into a client tag, then bind to that client tag in window 2.

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 11, 2023, 2:31pm UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/8 "2023-10-11T14:31:27Z")

</div>

Am I still able to subtract the data of my power table like in some similar way as this code:  
{Root Container.Power Table.data}[{Root Container.Num},"Tekst"]

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 11, 2023, 2:38pm UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/9 "2023-10-11T14:38:29Z")

</div>

I have searched some information about client tags and it looks like it is the answer but I don't see them in my designer. I'm using 8.1.23 version.

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [October 11, 2023, 2:41pm UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/10 "2023-10-11T14:41:49Z")

</div>

Make sure you have the Vision workspace open in the designer (having any vision window open should work). Then select `Vision Client Tags` in the tag browser dropdown pictured below.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/4/f4e753663c880f275b72ef86ce94536428954c61.png)

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 12, 2023, 5:43am UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/11 "2023-10-12T05:43:00Z")

</div>

Aah, thanks!! I will try to see if I can make this work.

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 12, 2023, 6:52am UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/12 "2023-10-12T06:52:10Z")

</div>

The problem I'm facing now is that this code is only available in a certain window:  
`{Root Container.Power Table.data}[1,"ColumnName"]`  
The string that is in this path is what I want to pass to my vision client tag so that I can bound that vision client tag to a label in some other window. But using the expression of my vision client tag I'm not able to select my row and column of my power table.

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 12, 2023, 9:20am UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/13 "2023-10-12T09:20:49Z")

</div>

I found a way to make it possible!

```auto
try:
	value = system.gui.getWindow('csv file test').getRootContainer().getComponent('Power Table').data.getValueAt(event.source.parent.parent.DiginNumber-1,"Text")
	system.gui.getWindow('Pop-Up window/L4_CM/Digitale Ingang').getRootContainer().getComponent('Label').text = str("<html>"+ value)
except ValueError:
	print "could not proceed"

```

I have put this code in the button I use to open the window that has the label in it that had to show the text of my power table. Based on the parameter I pass as a row number it grabs the right text for my label.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [October 12, 2023, 9:32am UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/14 "2023-10-12T09:32:12Z")

</div>

Where does the table's data come from ?  
It may be easier to pull the label's text from the same data source

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 12, 2023, 9:36am UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/15 "2023-10-12T09:36:42Z")

</div>

from a csv file.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [October 12, 2023, 9:43am UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/16 "2023-10-12T09:43:05Z")

</div>

Then maybe you could create a dataset client tag from this csv instead of using it to populate the table,  
then use that as a common source.  
You could bind both the table and the label to that tag, using a `lookup` expression for the label.

Seems "cleaner" to me than fetching data from another window that may or may not be opened and may or may not contain the expected data.

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 12, 2023, 9:50am UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/17 "2023-10-12T09:50:20Z")

</div>

im not able to import my csv file into the dataset of the tag

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 12, 2023, 9:51am UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/18 "2023-10-12T09:51:07Z")

</div>

i think im doing it wrong but how can I import the csv in the data set of that tag

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [October 12, 2023, 9:51am UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/19 "2023-10-12T09:51:39Z")

</div>

How do you import from the csv into the table ?

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [October 12, 2023, 9:52am UTC](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339/20 "2023-10-12T09:52:55Z")

</div>

with the use of a button. I have created a button that let me select a file and then put it in the power table  
like this:

```auto
# In this example it is assumed that the CSV file being read was a dataset that was previously exported using system.dataset.toCSV:
# Specify file path
file_path = system.file.openFile("csv")
# Read in the file as a string
data_string = system.file.readFileAsString(file_path)
# Convert the string to a dataset and store in a variable
data = system.dataset.fromCSV(data_string)
# Assign the dataset to a table
event.source.parent.getComponent('Power Table').data = data

```

[Next page](https://forum.inductiveautomation.com/t/using-the-information-of-a-power-table-in-a-label-that-is-in-another-window/80339.md?page=2)
