# System.tag.configure with UDTs in Folder

**URL:** <https://forum.inductiveautomation.com/t/system-tag-configure-with-udts-in-folder/41254>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [December 7, 2020, 9:09am UTC](https://forum.inductiveautomation.com/t/system-tag-configure-with-udts-in-folder/41254 "2020-12-07T09:09:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [December 7, 2020, 9:09am UTC](https://forum.inductiveautomation.com/t/system-tag-configure-with-udts-in-folder/41254/1 "2020-12-07T09:09:00Z")

</div>

Hi,

I’m trying to create a script that will take UDT definitions from one provider and distribute it to other providers on the same gateway. EAM can send it to the source provider on each gateway and this script can send it to the rest of the tag providers.

The issue I’m experiencing is that the configuration on the target somehow inserts a \_types \_ subfolder. See code and result below:

```auto
def syncUDTs(sourceProvider, targetProviders = None):

	configs = system.tag.getConfiguration('['+sourceProvider+']_types_/Test Folder', True)
	for target in targetProviders:
		system.tag.configure('['+target+']_types_', configs, "o")
	
	return

syncUDTs('Development', targetProviders = ['udtSync'])

```

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

The config doesn’t seem to contains \_types \_ subfolder under the _Test Folder_, hence I don’t know how to get rid of it. See _configs_ below (the print mangled the quotations):

```auto
[
    {'tags': [
            {'path': Test UDT 2, 'tagType': UdtType, 'name': 'Test UDT 2', 'typeId': None
            },
            {'path': Test UDT 1, 'tagType': UdtType, 'name': 'Test UDT 1', 'typeId': None
            }
        ], 'path': [Development]_types_/Test Folder, 'tagType': Folder, 'name': 'Test Folder'
    }
]

```

Is this a bug or can I somehow get the UDTs into the target while preserving the original structure?

Thanks,  
Deon

---

<div class="post-metadata">

**Author:** ![louagejasper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/louagejasper/32/86311_2.png) [@louagejasper](https://forum.inductiveautomation.com/u/louagejasper)\
**Post date:** [October 22, 2021, 9:50am UTC](https://forum.inductiveautomation.com/t/system-tag-configure-with-udts-in-folder/41254/2 "2021-10-22T09:50:21Z")

</div>

Has this issue been resolved? I’m having the same problem.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [June 8, 2022, 9:50pm UTC](https://forum.inductiveautomation.com/t/system-tag-configure-with-udts-in-folder/41254/3 "2022-06-08T21:50:34Z")

</div>

I just tried this in 8.1.17 and ran into the same issue. It seems a “_types_” parent folder is added to the whole configuration as well as above the type definitions in any subfolders (original tag configuration read did not include the highlighted folders below):  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/1/410b1f6d64c16ee268f6faf97003259862c38c83.png)  
Has anyone found a workaround for this?

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [June 9, 2022, 4:44am UTC](https://forum.inductiveautomation.com/t/system-tag-configure-with-udts-in-folder/41254/4 "2022-06-09T04:44:11Z")

</div>

I did solve this, but it involve some string manipulation to filter out the _types_

---

<div class="post-metadata">

**Author:** ![Clancy\_Cavanaugh](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@Clancy\_Cavanaugh](https://forum.inductiveautomation.com/u/Clancy_Cavanaugh)\
**Post date:** [May 27, 2025, 8:21pm UTC](https://forum.inductiveautomation.com/t/system-tag-configure-with-udts-in-folder/41254/5 "2025-05-27T20:21:27Z")

</div>

In case anyone else runs into this, I wanted to pass along my solution.

I couldn't find any string manipulation that made sense, but did find that removing the 'path' keys from all dictionaries returned from system.tag.getConfiguration eliminated the \_types\_ folders that were erroneously being added.

This does not appear to work as expected if you are utilizing UDT Inheritance with overridden values. If you are then tags with an overridden value will be duplicated instead.  
_Edit: A hacky solution is to run the system.tag.configure function twice with 'o' for the collision policy. I'm pretty sure the root issue has something to do with the parent UDT getting created after the child UDT._

Example code below

```python
global_udt_folder_path = '[global]_types_/global_UDTs'

def remove_path_keys(udt_configs):
	if isinstance(udt_configs, list):
		return [remove_path_keys(item) for item in udt_configs]
	elif isinstance(udt_configs, dict):
		return {
			key: remove_path_keys(value)
			for key, value in udt_configs.items()
			if key != "path"
		}
	else:
		return udt_configs

def global_udts():
	udt_configs = system.tag.getConfiguration(global_udt_folder_path, True)
	udt_configs = remove_path_keys(udt_configs)
	system.tag.configure('[default]_types_', udt_configs, 'o')

```
