# BUG 15262\]- UDT parameters cannot be referenced in tag event script in 8

**URL:** <https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197>\
**Category:** Ignition Early Access\
**Created:** [October 18, 2019, 2:46pm UTC](https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197 "2019-10-18T14:46:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walt](https://avatars.discourse-cdn.com/v4/letter/w/71e660/32.png) [@Walt](https://forum.inductiveautomation.com/u/Walt)\
**Post date:** [October 18, 2019, 2:46pm UTC](https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197/1 "2019-10-18T14:46:25Z")

</div>

Upgraded to 8.0.5 and my tag event scripts that use the tag[‘paramName’] feature to access UDT parameters are broken. The tag[] call is returning None.

---

<div class="post-metadata">

**Author:** ![anjoroge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/anjoroge/32/6698_2.png) [@anjoroge](https://forum.inductiveautomation.com/u/anjoroge)\
**Post date:** [October 28, 2019, 10:28pm UTC](https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197/2 "2019-10-28T22:28:53Z")

</div>

Hi Walt,

We are currently tracking this issue and actively working on a fix for it. Thanks for providing us info on the matter.

Anthony

---

<div class="post-metadata">

**Author:** ![Walt](https://avatars.discourse-cdn.com/v4/letter/w/71e660/32.png) [@Walt](https://forum.inductiveautomation.com/u/Walt)\
**Post date:** [December 18, 2019, 1:37pm UTC](https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197/3 "2019-12-18T13:37:14Z")

</div>

The change logs indicated a fix for this in the 8.0.7 RC1, but the bug still exists.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 18, 2019, 4:47pm UTC](https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197/4 "2019-12-18T16:47:35Z")

</div>

Can you define ‘broken’ more specifically? Skimming through the notes on the bug ticket, there’s some quirks, such as having to restart the tag for event scripts to update if you write to a UDT parameter, that are probably on training’s list to document once 8.0.7 full is available.

---

<div class="post-metadata">

**Author:** ![Walt](https://avatars.discourse-cdn.com/v4/letter/w/71e660/32.png) [@Walt](https://forum.inductiveautomation.com/u/Walt)\
**Post date:** [December 18, 2019, 5:27pm UTC](https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197/5 "2019-12-18T17:27:05Z")

</div>

The gateway was rebooted after the upgrade to 8.0.7 and every instance of tag[] still seems to return None. We are not dynamically changing parameter values.

We were using it in a couple different UDTs to read the parameter value. One was critical so we replaced it with expression tags to pull in the parameters and tag reads to read from the expression tags. I’ll probably do the same with the others.

---

<div class="post-metadata">

**Author:** ![dkylep](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dkylep](https://forum.inductiveautomation.com/u/dkylep)\
**Post date:** [April 27, 2020, 9:00pm UTC](https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197/6 "2020-04-27T21:00:44Z")

</div>

Is this bug still lingering?  
I’m trying to do a change event script and can’t seem to get the UDT parameters. I found this [UDTParametersinTagEventScripts](https://docs.inductiveautomation.com/display/DOC80/Tag+Event+Scripts#TagEventScripts-UDTParametersinTagEventScripts) in the docs but it doesn’t seem to work.

I have a UDT (UDT01) with a parameter param1 and two memory tags (Tag1 and Tag2), both are of type string.

I created an instance of UDT01 with ‘param1’ set to the string “Finish”.

If I create the following ‘Value Changed’ event script in Tag2

```auto
	system.tag.write("[.]Tag1","Start")
	system.tag.write("[.]Tag1",tag['parameters']['param1'])

```

Tag1 does update to the string “Start” but Tag1 will not update to the value of param1 (‘Finish’)

I get the following error in the gateway log

```auto
Caused by: org.python.core.PyException: Traceback (most recent call last): File "", line 3, in valueChanged TypeError: 'com.inductiveautomation.ignition.gateway.tags.runtime.nodes.complex.ExecutableTagPropertyModel$LocalParameterObservablePropertySource' object is unsubscriptable

```

I realize I can create another tag in the UDT that is set to the parameter and then read that tag in the script but I’d rather just reference the parameter directly if it’s an options.

---

<div class="post-metadata">

**Author:** ![Walt](https://avatars.discourse-cdn.com/v4/letter/w/71e660/32.png) [@Walt](https://forum.inductiveautomation.com/u/Walt)\
**Post date:** [April 27, 2020, 9:34pm UTC](https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197/7 "2020-04-27T21:34:02Z")

</div>

I believe it was fixed in 8.0.10.

I am terrible with syntax from memory, but I believe you need to do the following.

system.tag.write("[.]Tag1",“Start”)  
system.tag.write("[.]Tag1",tag[‘param1’])

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [April 27, 2020, 10:26pm UTC](https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197/8 "2020-04-27T22:26:19Z")

</div>

The correct syntax according to our docs is:

`tag['parameters']['param1']`

This was supposed to be fixed in 8.0.7, but appears to have regressed. For now, you can try the legacy syntax:

{param1}

The caveat with the legacy syntax is that value changes to the parameter wouldn’t be updated in event scripts unless the UDT was restarted, so this may not be a viable option if you have parameter values that are be changed outside of editing the UDT via the tag config. More info can be found here: [https://docs.inductiveautomation.com/display/DOC80/Tag+Event+Scripts](https://docs.inductiveautomation.com/display/DOC80/Tag+Event+Scripts)

---

<div class="post-metadata">

**Author:** ![dkylep](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dkylep](https://forum.inductiveautomation.com/u/dkylep)\
**Post date:** [April 28, 2020, 1:36pm UTC](https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197/9 "2020-04-28T13:36:44Z")

</div>

Thanks, @James.Lorenz. You’re right, the legacy syntax is not a viable option. I did try the legacy syntax.  
If I use…  
`system.tag.write("[.]Tag1",'{param1}')`  
it works as described.

For now, I’ll just utilize some additional memory tags to hold the parameter values. I can just reference those tags in the event script.

I did try some variations of @Walt’s syntax, just for fun, but I could not get it to work.

I’m using 8.0.12

---

<div class="post-metadata">

**Author:** ![Walt](https://avatars.discourse-cdn.com/v4/letter/w/71e660/32.png) [@Walt](https://forum.inductiveautomation.com/u/Walt)\
**Post date:** [April 28, 2020, 2:59pm UTC](https://forum.inductiveautomation.com/t/bug-15262-udt-parameters-cannot-be-referenced-in-tag-event-script-in-8/29197/10 "2020-04-28T14:59:13Z")

</div>

Interesting. I went and looked at one of my scripts that is working and I just do tag[‘ParamName’] to get the parameter value. I believe I took that from the original 8.0 documentation. It was broken in roughly 8.0.4 and started working again when we got to 8.0.10.

Based on James’ link it looks like something changed in 8.0.7.
