# Change UDT from Script

**URL:** <https://forum.inductiveautomation.com/t/change-udt-from-script/98307>\
**Category:** Ignition\
**Created:** [November 6, 2024, 9:56pm UTC](https://forum.inductiveautomation.com/t/change-udt-from-script/98307 "2024-11-06T21:56:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwhite](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bwhite/32/7112_2.png) [@bwhite](https://forum.inductiveautomation.com/u/bwhite)\
**Post date:** [November 6, 2024, 9:56pm UTC](https://forum.inductiveautomation.com/t/change-udt-from-script/98307/1 "2024-11-06T21:56:42Z")

</div>

I need to change the names of my tags within a UDT to something more cryptic. But I want to copy the current name to the documentation before I make the change. I have several hundred tags in each UDT and several dozen UDTs. Is there a way to loop through each tag in a UDT in a script?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [November 6, 2024, 10:00pm UTC](https://forum.inductiveautomation.com/t/change-udt-from-script/98307/2 "2024-11-06T22:00:29Z")

</div>

You'll probably need to use [`system.tag.getConfiguration`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-getConfiguration) in conjunction with [`system.tag.configure`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-configure).

---

<div class="post-metadata">

**Author:** ![stevenson](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@stevenson](https://forum.inductiveautomation.com/u/stevenson)\
**Post date:** [November 7, 2024, 7:38pm UTC](https://forum.inductiveautomation.com/t/change-udt-from-script/98307/3 "2024-11-07T19:38:16Z")

</div>

I think something like this should work. I just renamed the tag name to be \_ OldTagName \_, so you can replace with your aliasing llogic.

```python
udtFolderPath = "[default]_types_/SomeUDTs"
udtDefs = system.tag.browse(udtFolderPath)
for uDef in udtDefs:
	print uDef
	tagConf = system.tag.getConfiguration(uDef["fullPath"], True)[0]
	
	for tag in tagConf["tags"]:
		tag["documentation"] = tag["name"]
		tag["name"] = "_%s_"%(tag["name"])
	
	system.tag.configure(udtFolderPath, tagConf)		
		

```
