# Pass tag property to window property

**URL:** <https://forum.inductiveautomation.com/t/pass-tag-property-to-window-property/19943>\
**Category:** Ignition\
**Created:** [October 3, 2018, 1:08am UTC](https://forum.inductiveautomation.com/t/pass-tag-property-to-window-property/19943 "2018-10-03T01:08:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [October 3, 2018, 1:08am UTC](https://forum.inductiveautomation.com/t/pass-tag-property-to-window-property/19943/1 "2018-10-03T01:08:54Z")

</div>

I have a tag UDT definition called Motor. This UDT has a custom parameter “Description”. Each time I create an instance of this UDT, I enter the motor description so that I can use it in alarm messages and such.

I also have a popup window, which is the motor control popup (e.g. status, start/stop, etc). This motor window has a custom property “TagPath”, where I specify the path to the tag so that I can call the same popup with multiple instances of the Motor tag.

At the top of the popup I’d like to display the description of the motor. I can create a label, and I’ve got access to the tag path, but I can’t find a way to use that tag path to obtain the value of the specified tag’s “Description” property.

I know I could pass a description string to the window when I open it, but again, I can pass a window property or a tag value, but I can’t find a way to pass a tag property.

Any help is appreciated!

[edit] while I play around, I’m sending a hard-coded string. It’s working, but when I’ve got the label’s text property bound to the Description property, I then can’t use HTML to wrap the text across multiple lines. So, once I have my motor description being passed in correctly, any ideas on how to force the label object to display it with HTML (or at least, across multiple lines)?

---

<div class="post-metadata">

**Author:** ![Andrew\_P](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Andrew\_P](https://forum.inductiveautomation.com/u/Andrew_P)\
**Post date:** [October 3, 2018, 11:03am UTC](https://forum.inductiveautomation.com/t/pass-tag-property-to-window-property/19943/2 "2018-10-03T11:03:11Z")

</div>

Take a look at this post

> [@Reading UDT Parameter Value?](http://forum.inductiveautomation.com/t/reading-udt-parameter-value/11872):
>
> Hi All, Is there any ways to read a UDT Parameter value (for example I have a parameter called alarmDescription on UDT tank\_anomaly). I need to be able to read this value into a script. Doing a UDT Binding on a window does not show the parameter values. Or is there a way to read parameter values from the binding? Thank you!

As for the html, just use an expression bound to the text property of the label like:  
`"<html>" + {<your string type property>}`

I don't bother with closing html tags anymore unless I need to limit the scope

You can also use the html tag or

to otherwise format text after a html tag for text alignment etc. in addition to the wrapping you get from the "conversion" to html, although it sounds like you might already be familiar with this.

---

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [October 4, 2018, 3:51am UTC](https://forum.inductiveautomation.com/t/pass-tag-property-to-window-property/19943/3 "2018-10-04T03:51:57Z")

</div>

Thanks, got it working with that thread. I ended up not using the window properties at all, I just ran the following script on window startup:

[code]TagPath = “%s.ExtendedProperties” % system.gui.getParentWindow(event).getComponentForPath(‘Root Container’).TagPath  
TagProperties = system.tag.read(TagPath)

if TagProperties.value is not None:  
for Property in TagProperties.value:  
if Property.getProperty().name == ‘Description’:  
system.gui.getParentWindow(event).getComponentForPath(‘Root Container.Motor Description’).text = ‘’+Property.value   
break[/code]

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [October 4, 2018, 7:50pm UTC](https://forum.inductiveautomation.com/t/pass-tag-property-to-window-property/19943/4 "2018-10-04T19:50:52Z")

</div>

A much simpler way is to just create an expression tag in the UDT.  
Name it something like MetaDescription and set its expression to ‘{Description}’

We do one for each of our UDT parameters, that makes them available to the UDT and windows.

---

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [October 4, 2018, 11:24pm UTC](https://forum.inductiveautomation.com/t/pass-tag-property-to-window-property/19943/5 "2018-10-04T23:24:15Z")

</div>

That is nice and simple! I think I’ll do that, it’ll be much easier to see what’s going on for people in the future.
