# Rename name of UDT with a script

**URL:** <https://forum.inductiveautomation.com/t/rename-name-of-udt-with-a-script/8073>\
**Category:** Ignition\
**Created:** [February 27, 2014, 9:14am UTC](https://forum.inductiveautomation.com/t/rename-name-of-udt-with-a-script/8073 "2014-02-27T09:14:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nadya](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@Nadya](https://forum.inductiveautomation.com/u/Nadya)\
**Post date:** [February 27, 2014, 9:14am UTC](https://forum.inductiveautomation.com/t/rename-name-of-udt-with-a-script/8073/1 "2014-02-27T09:14:06Z")

</div>

I create list of udt with differents attributs.  
Now I want mofify the name of UDT but I met a problem Ignition give an error : does not writing of the tag and the project is Mode read/ write gateway.  
Here is the script : system.tag.write("[]Tag.name",‘test’,1)

Thank You for your help.

---

<div class="post-metadata">

**Author:** ![Niks](https://avatars.discourse-cdn.com/v4/letter/n/e19b73/32.png) [@Niks](https://forum.inductiveautomation.com/u/Niks)\
**Post date:** [February 28, 2014, 6:57am UTC](https://forum.inductiveautomation.com/t/rename-name-of-udt-with-a-script/8073/2 "2014-02-28T06:57:40Z")

</div>

Nadya,

I don’t think there will be any problem in modifying the UDT name.

Can you please elaborate the problem.

What i understand,  
You have created 1 UDT under this UDT suppose you have 1 Expression tag and that tag have script that you mentioned.

If this is correct then there should not have any issue.

---

<div class="post-metadata">

**Author:** ![Nadya](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@Nadya](https://forum.inductiveautomation.com/u/Nadya)\
**Post date:** [February 28, 2014, 10:01am UTC](https://forum.inductiveautomation.com/t/rename-name-of-udt-with-a-script/8073/3 "2014-02-28T10:01:54Z")

</div>

Hello Niks,

Thanks for take the time to help me. 😃

In fact, I generate several UDTs with a script which import file csv and add tag with differents attributs.  
system.tag.addTag(parentPath=“ControlLoops”, name=“Test2”, tagType=“UDT\_INST”,  
attributes={“UDTParentType”:“ControlLoop”},  
overrides={“conf\_PV\_max”:{“Expression”:"{[~]Boucle de Regulation/Boucle Classique/%s}" % row[“Mesure Process”] }…

No problem with this instruction but now I want modify just the name of UDT with a script, it’s not possible.  
I can modify the differents attributes of UDT for example “conf\_PV\_max” with this instructions system.tag.write("[]Test2/conf\_PV\_max",‘Test’,1). but no the name.

Ignition generate an error tag does not writing with this instruction system.tag.write("[]Test2.name",‘Test’,1).  
You understand now what is the problem, I try differents solutions none works 😢

Thanks

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [February 28, 2014, 11:17am UTC](https://forum.inductiveautomation.com/t/rename-name-of-udt-with-a-script/8073/4 "2014-02-28T11:17:03Z")

</div>

you cant write to every attribute using system.tag.write. you may want to try using the editTag function of the ialabs scripting module, that would be your best bet at doing this.

---

<div class="post-metadata">

**Author:** ![Nadya](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@Nadya](https://forum.inductiveautomation.com/u/Nadya)\
**Post date:** [February 28, 2014, 1:08pm UTC](https://forum.inductiveautomation.com/t/rename-name-of-udt-with-a-script/8073/5 "2014-02-28T13:08:47Z")

</div>

I try it, it just edit and not write 😢  
Tks

---

<div class="post-metadata">

**Author:** ![Nadya](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@Nadya](https://forum.inductiveautomation.com/u/Nadya)\
**Post date:** [February 28, 2014, 2:54pm UTC](https://forum.inductiveautomation.com/t/rename-name-of-udt-with-a-script/8073/6 "2014-02-28T14:54:38Z")

</div>

Thank you Diat150

I try again with this instruction print system.tag.editTag(tagPath=“test/Test2”, attributes={“Name”:“ttt”} ) and finally it works

Thank you very much for your help
