# Create UDT Instance with specified UDT Definition in ManagedTagProvider

**URL:** <https://forum.inductiveautomation.com/t/create-udt-instance-with-specified-udt-definition-in-managedtagprovider/105733>\
**Category:** Module Development\
**Created:** [April 30, 2025, 2:47pm UTC](https://forum.inductiveautomation.com/t/create-udt-instance-with-specified-udt-definition-in-managedtagprovider/105733 "2025-04-30T14:47:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhys.nickerson](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@rhys.nickerson](https://forum.inductiveautomation.com/u/rhys.nickerson)\
**Post date:** [April 30, 2025, 2:47pm UTC](https://forum.inductiveautomation.com/t/create-udt-instance-with-specified-udt-definition-in-managedtagprovider/105733/1 "2025-04-30T14:47:09Z")

</div>

Hello, I am struggling to determine how to create a UDT Instance with a specified UDT parent data type in version 8.1.48 of the java SDK.

I am able to create a UDT definition for a ManagedTagProvider as follows:

```java
// create ManagedTagProvider
ProviderConfiguration configuration = new ProviderConfiguration(name);
        configuration.setAllowTagCustomization(true);
        configuration.setPersistTags(false);
        configuration.setPersistValues(false);
        configuration.setAllowTagDeletion(true);
        configuration.setAttribute(TagProviderMeta.FLAG_PROVIDES_COMPLEX_TYPES, true);

// assume context (of type GatewayContext) is defined 
ManagedTagProvider provider = context.getTagManager.getOrCreateManagedProvider("My Provider", configuration); 

// create UDT Definition
TagConfiguration myDefinition = new TagConfigurationBuilder().name("MyDefinition").property(WellKnownTagProps.TagType, TagObjectType.UdtType).build();
provider.configureTag("MyDefinition", myDefinition)

```

It is unclear how to define a UDT Instance with the Parent Data Type set, and I have been unable to find this documented anywhere. I have tried the following:

- set `WellKnownUDTParameters.PathToParentFolder` to the UDT definition path
- set the UDT instance `TagConfiguration` as a child of the UDT definition
- set UDT Instance `DataType` tag property to the UDT defintion

If anyone knows of a way to do this I would appreciate it! Thanks!

---

<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:** [April 30, 2025, 3:32pm UTC](https://forum.inductiveautomation.com/t/create-udt-instance-with-specified-udt-definition-in-managedtagprovider/105733/2 "2025-04-30T15:32:55Z")

</div>

UDT definitions have to be placed under the `_types_` folder in the provider. Try that.

---

<div class="post-metadata">

**Author:** ![rhys.nickerson](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@rhys.nickerson](https://forum.inductiveautomation.com/u/rhys.nickerson)\
**Post date:** [April 30, 2025, 3:45pm UTC](https://forum.inductiveautomation.com/t/create-udt-instance-with-specified-udt-definition-in-managedtagprovider/105733/3 "2025-04-30T15:45:04Z")

</div>

It seems both: `provider.configureTag("_types_/Blower", modelConfig)` and ` provider.configureTag("Blower", modelConfig)` work to create UDT Definitions.

I am able to successfully create UDT Definitions:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/2/32cad09cee3122248b074bae90214855971300d6.png)

Where I having issues is specifying the definition for a UDT Instance I create for the Tag Provider:

```java
TagConfiguration instanceConfig = new TagConfigurationBuilder().member("_types_/Blower").name("Blower1").property(WellKnownTagProps.TagType, TagObjectType.UdtInstance).build();
provider.configureTag("Blower1", instanceConfig);

```

But the resulting Tag has issues:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/0/90e2f4bd81ae13f17099a3b31035dd86fe0d6206.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0cf03b3c75cb8b152a41b663af424b0f4ff0c989.png)

---

<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:** [April 30, 2025, 3:54pm UTC](https://forum.inductiveautomation.com/t/create-udt-instance-with-specified-udt-definition-in-managedtagprovider/105733/4 "2025-04-30T15:54:40Z")

</div>

> [@rhys.nickerson](#):
>
> `.member("_types_/Blower")`

That doesn't look right. I would expect you to need to set `WellKnownTagProps.TypeId` to "Blower".

> **[WellKnownTagProps](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.47/com/inductiveautomation/ignition/common/tags/config/properties/WellKnownTagProps.html#TypeId)**
>
> declaration: package: com.inductiveautomation.ignition.common.tags.config.properties, class: WellKnownTagProps

---

<div class="post-metadata">

**Author:** ![rhys.nickerson](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@rhys.nickerson](https://forum.inductiveautomation.com/u/rhys.nickerson)\
**Post date:** [April 30, 2025, 4:01pm UTC](https://forum.inductiveautomation.com/t/create-udt-instance-with-specified-udt-definition-in-managedtagprovider/105733/5 "2025-04-30T16:01:05Z")

</div>

That works, thank you!
