Error creating dynamic tags

I am trying to create a UDT tag dynamically inside one of the existing tags, but it is not working.

tagPath="[default]test"
#name="cook"

# 1) Create the UDT instance from the DEFINITION, not the internal _types_ path
system.tag.configure(tagPath, [{
    "name": "cook",
    "type": "UDT_INST",
    "udtTypeId": "test",   # <= use the UDT definition path
    "enabled": True
}], "o")

It is not working; it creates the UDT but does not create the child tags inside.

You cannot. UDT structures are fixed.

If you need variant structures, you typically need to use a regular tag folder. (Though you might make multiple UDTs from a base UDT.)

I know UDT structures are fixed. I am trying to get a UDT into a normal tag

Ok. Might be a bug. I don't recall seeing anything like this, so you probably want to open a support ticket.

I don’t know where you got these from, but I suggest you create a UDT instance manually and check its json. The type should be "tagType": "UdtInstance" and use "typeId”: ”test”

On second thoughts, I'll bet this came from AI

Your original code is just creating a memory tag with those two added custom props in it

1 Like

tagPath="[default]test"
#name="cook"

# 1) Create the UDT instance from the DEFINITION, not the internal _types_ path
system.tag.configure(tagPath, [{
"name": "cook",
"tagType": "UdtInstance",
"UdtType": "test", # <= use the UDT definition path
"enabled": True
}], "o")

I am getting parent data type doesn’t exists

You ignored this part, and for some reason you renamed

To

When I said

yes it’s working..Thank you