# Passing parameters to UDT

**URL:** <https://forum.inductiveautomation.com/t/passing-parameters-to-udt/74533>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [June 3, 2023, 7:22pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-udt/74533 "2023-06-03T19:22:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 3, 2023, 7:22pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-udt/74533/1 "2023-06-03T19:22:26Z")

</div>

I've forgotten how to do something I think I've accomplished before. I can't see how to pass a value from a UDT parent as a parameter in the nested UDT.

 ![UDT params](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/7/77e7f3b053f5759f02a23fc3b867e6fb57033530.png)

Can anyone give me a reminder? I haven't found a how-to in the manual or in the forum.

Thanks.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [June 3, 2023, 7:55pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-udt/74533/2 "2023-06-03T19:55:54Z")

</div>

Maybe using the keyword `this`?

I don't think I've done what you are trying to do either.

---

<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:** [June 3, 2023, 8:48pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-udt/74533/3 "2023-06-03T20:48:08Z")

</div>

If the source is a tag, you cannot. Or rather, you have to rely on a tag event script on the source to write to the peer UDT instance's parameter.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 3, 2023, 9:05pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-udt/74533/4 "2023-06-03T21:05:22Z")

</div>

Hmm, yes. I've figured out that I can put `{paramMachineId}` as an expression in the nested UDT tag.  
I need to rethink my strategy in the light of that.

---

<div class="post-metadata">

**Author:** ![zbinder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zbinder/32/28918_2.png) [@zbinder](https://forum.inductiveautomation.com/u/zbinder)\
**Post date:** [June 5, 2023, 1:17pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-udt/74533/5 "2023-06-05T13:17:49Z")

</div>

Not sure what your full intent is, but I've created folders in parent UDTs with a number of tags that need to be written to child tags/parameters and a script trigger Boolean. When you manually set the Boolean true, its tag change script will write the parameters to their proper places in child tags and then write itself back to zero.

If you want it to update live, you may also be able to accomplish this with a tag change script on the elements in the parent tag themselves.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 5, 2023, 1:24pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-udt/74533/6 "2023-06-05T13:24:26Z")

</div>

That's an interesting approach, thanks. I might try that.

---

<div class="post-metadata">

**Author:** ![zbinder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zbinder/32/28918_2.png) [@zbinder](https://forum.inductiveautomation.com/u/zbinder)\
**Post date:** [June 29, 2023, 1:48pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-udt/74533/7 "2023-06-29T13:48:20Z")

</div>

Did you ever figure out a solution to this?

I recently published a resource that uses the technique I mentioned. It doesn't actually use nested UDTs, but the scripting could easily be modified for them.

> **[Ignition Exchange](https://inductiveautomation.com/exchange/2506/overview)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.
