UDT Parameter in a Tag Change script

Hi all,

I’m on 8.1.7 and I’m trying to access a UDT parameter as follows but I seem to be getting a null value:

siteName = tag[‘parameters’][‘SiteName’]

Is this right?

I’m doing that in some of my scripts, what you have should work. Dumb question, but do you have a value in that parameter? If you haven’t assigned a value yet, I think the parameter may be null rather than a string.

Otherwise, I found it beneficial to explicitly cast to my desired to my desired type. In your case:
siteName = str(tag[‘parameters’][‘SiteName’])

Hi Cory,

I think I figured out the issue, I had to define siteName outside my function.