# Type cast to UDT

**URL:** <https://forum.inductiveautomation.com/t/type-cast-to-udt/5339>\
**Category:** Ignition\
**Created:** [October 27, 2012, 6:01pm UTC](https://forum.inductiveautomation.com/t/type-cast-to-udt/5339 "2012-10-27T18:01:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fadihindi](https://avatars.discourse-cdn.com/v4/letter/f/34f0e0/32.png) [@fadihindi](https://forum.inductiveautomation.com/u/fadihindi)\
**Post date:** [October 27, 2012, 6:01pm UTC](https://forum.inductiveautomation.com/t/type-cast-to-udt/5339/1 "2012-10-27T18:01:29Z")

</div>

Is there a way to pass a UDT variable in an event handler script to a parameterized window custom property expecting that UDT by building the UDT string?  
For example the variable “url” here needs to be a UDT that has already been defined:

url = event.source.parent.getComponent(‘Label’).text + “01”  
system.nav.openWindowInstance(“Param\_Window”, {‘URL’ : url})

here ‘url’ is built and interpreted as a string but needs to be passed as a UDT. This code returns an error that ‘url’ could not converted into ‘UDTProperty’

I could use type casting like toInt or toFloat for int and float but I don’t see a way to cast to a UDT.

---

<div class="post-metadata">

**Author:** ![Michael.Stofan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.stofan/32/3342_2.png) [@Michael.Stofan](https://forum.inductiveautomation.com/u/Michael.Stofan)\
**Post date:** [October 29, 2012, 4:22pm UTC](https://forum.inductiveautomation.com/t/type-cast-to-udt/5339/2 "2012-10-29T16:22:49Z")

</div>

Your best bet for now is to instead pass the path of the UDT (as a string) into the window you are opening. Just make sure the property on the window you are opening is also a String type. You can then use indirect bindings to the proper UDT based on the string you passed in.
