# Get UDT dropConfig References via Script

**URL:** <https://forum.inductiveautomation.com/t/get-udt-dropconfig-references-via-script/107222>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 10, 2025, 1:01pm UTC](https://forum.inductiveautomation.com/t/get-udt-dropconfig-references-via-script/107222 "2025-06-10T13:01:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [June 10, 2025, 1:01pm UTC](https://forum.inductiveautomation.com/t/get-udt-dropconfig-references-via-script/107222/1 "2025-06-10T13:01:50Z")

</div>

Is there a way to provide a UDT Type path, and get the relevant dropConfig references to it via script?

I know this is technically possible via some java methods I am sure, but not 100% where to start to find it.

Essentially we need to version some UDT definitions and corresponding views, and we are aiming to not have to store custom props on the UDT definitions that refer to a hardcoded view name. Feels a bit clunky.

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

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [June 10, 2025, 1:38pm UTC](https://forum.inductiveautomation.com/t/get-udt-dropconfig-references-via-script/107222/2 "2025-06-10T13:38:35Z")

</div>

I'm thinking this might be a good place to start:

> **[TagDropConfig](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.48/com/inductiveautomation/perspective/common/config/tagdrop/TagDropConfig.html)**
>
> declaration: package: com.inductiveautomation.perspective.common.config.tagdrop, class: TagDropConfig

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [June 10, 2025, 2:25pm UTC](https://forum.inductiveautomation.com/t/get-udt-dropconfig-references-via-script/107222/3 "2025-06-10T14:25:59Z")

</div>

I looked there, but I _think_ that is how you create a new tag drop config and not retrieve one? I tried playing with that for a while but I couldn't find any way to retrieve it based off UDT types

---

<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:** [June 10, 2025, 8:29pm UTC](https://forum.inductiveautomation.com/t/get-udt-dropconfig-references-via-script/107222/4 "2025-06-10T20:29:35Z")

</div>

I think you need to obtain an instance of TagDropConfig, using something like this (slightly different in 8.1, this is 8.3):

```java
        TagDropConfig dropConfig =
            Optional.ofNullable(designerContext.getProject())
                .flatMap(p -> p.getSingletonResource(TagDropConfig.RESOURCE_TYPE))
                .flatMap(Resource::getData)
                .filter(ImmutableBytes::hasBytes)
                .map(data -> GSON.fromJson(data.getBytesAsReader(), TagDropConfig.class))
                .orElse(TagDropConfig.createDefault());

```

And then ask it for the thing you want via `com.inductiveautomation.perspective.common.config.tagdrop.TagDropConfig#findComponentsFor`?

Disclaimer: I have never really understood how to set up tag drop in Perspective 😆

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [June 10, 2025, 9:56pm UTC](https://forum.inductiveautomation.com/t/get-udt-dropconfig-references-via-script/107222/5 "2025-06-10T21:56:22Z")

</div>

One other thing to keep in mind is that because tags are gateway resources and views are project resources, your results could be different based on the project you reference. If you're wanting to store this as part of the UDT, you'll need to make sure it also references the associated project. could store it as a string formatted similar to OPC tag paths `[Project]Folder/View`

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [June 11, 2025, 1:12pm UTC](https://forum.inductiveautomation.com/t/get-udt-dropconfig-references-via-script/107222/7 "2025-06-11T13:12:35Z")

</div>

Okay, I got some progress here, but am struggling to build the `NodeBrowseInfo ` and `NodeDescription ` that the `findComponentsFor` method needs.

```python
from com.inductiveautomation.ignition.common.tags.config.types import TagObjectType
from com.inductiveautomation.ignition.common.tags.browsing import NodeBrowseInfo, NodeDescription
from com.inductiveautomation.ignition.common.tags.paths import BasicTagPath

tag_path_str = "[default]_types_/MyFolder/MyUdtDefinition"
tag_path = BasicTagPath(tag_path_str)
node_desc = (NodeDescription.newBuilder()
    .fullPath(tag_path)
    .objectType(TagObjectType.UdtType)
    .build())
node_browse_info = NodeBrowseInfo(tag_path, node_desc)

```

Both of these give empty tag descriptions when printed, and therefore dont return anything in the list. Any ideas?

```python
>>> node_desc
TagDescription [name=null, dataType=null, currentValue=null, objectType=UdtType, subTypeId=null, attributes=null, hasChildren=false, displayFormat=null, tooltip=null]
>>> node_browse_info
TagDescription [name=null, dataType=null, currentValue=null, objectType=UdtType, subTypeId=null, attributes=null, hasChildren=false, displayFormat=null, tooltip=null]

```

I also tried with an instance's path and `TagObjectType.UdtInstance`. Still no luck

> **For completeness, here is the whole script so far**
>
> ```python
> from com.inductiveautomation.perspective.common.config.tagdrop import TagDropConfig
> from com.inductiveautomation.ignition.common import TypeUtilities
> from com.inductiveautomation.ignition.designer import IgnitionDesigner
> from com.inductiveautomation.ignition.common.tags.browsing import NodeBrowseInfo, NodeDescription
> from com.inductiveautomation.ignition.common.tags.paths import BasicTagPath
> from com.inductiveautomation.ignition.common.tags.config.types import TagObjectType
> from java.util import Optional
> from org.python.core import PyString
> from java.util.function import Function, Predicate
> 
> # Helper for Java Function
> class PyFunction(Function):
> def __init__ (self, func):
> self.func = func
> def apply(self, arg):
> return self.func(arg)
> 
> # Helper for Java Predicate
> class PyPredicate(Predicate):
> def __init__ (self, func):
> self.func = func
> def test(self, arg):
> return self.func(arg)
> 
> designerContext = IgnitionDesigner.getFrame().context
> dropConfig = (Optional.ofNullable(designerContext.getProject())
> .flatMap(PyFunction(lambda p: p.getSingletonResource(TagDropConfig.RESOURCE_TYPE)))
> .flatMap(PyFunction(lambda r: r.getData()))
> .filter(PyPredicate(lambda data: data.hasBytes()))
> .map(PyFunction(lambda data: TypeUtilities.gsonToPy(TypeUtilities.pyToGson(PyString(data.getBytesAsReader().readString())))))
> .map(PyFunction(lambda pyObj: TagDropConfig.fromJson(pyObj.toString())))
> .orElse(TagDropConfig.createDefault()))
> 
> tag_path_str = "[default]_types_/MyFolder/MyUdtDefinition"
> tag_path = BasicTagPath(tag_path_str)
> node_desc = (NodeDescription.newBuilder()
> .fullPath(tag_path)
> .objectType(TagObjectType.UdtType)
> .build())
> node_browse_info = NodeBrowseInfo(tag_path, node_desc)
> 
> components = dropConfig.findComponentsFor(node_browse_info)
> 
> print components # returns []
> 
> ```

---

<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:** [June 11, 2025, 4:24pm UTC](https://forum.inductiveautomation.com/t/get-udt-dropconfig-references-via-script/107222/8 "2025-06-11T16:24:01Z")

</div>

You might have a better time calling the underlying `browseAsync` method yourself to get a `NodeDescription` back:  
`com.inductiveautomation.ignition.common.tags.model.TagManager#browseAsync(com.inductiveautomation.ignition.common.tags.model.TagPath, com.inductiveautomation.ignition.common.browsing.BrowseFilter)` returns a `CompletableFuture<Results<NodeDescription>>`.
