# Move tag by script

**URL:** <https://forum.inductiveautomation.com/t/move-tag-by-script/18947>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [July 24, 2018, 1:23pm UTC](https://forum.inductiveautomation.com/t/move-tag-by-script/18947 "2018-07-24T13:23:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lettierf](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lettierf/32/7431_2.png) [@lettierf](https://forum.inductiveautomation.com/u/lettierf)\
**Post date:** [July 24, 2018, 1:23pm UTC](https://forum.inductiveautomation.com/t/move-tag-by-script/18947/1 "2018-07-24T13:23:25Z")

</div>

Hi all  
is there a way to move a tag by using script? I have to move a tag from a folder called “temp” to the main folder  
Thank you

---

<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:** [July 24, 2018, 2:56pm UTC](https://forum.inductiveautomation.com/t/move-tag-by-script/18947/2 "2018-07-24T14:56:00Z")

</div>

There’s no way to move a tag - you can only remove it and re-create it in the new location.

---

<div class="post-metadata">

**Author:** ![lettierf](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lettierf/32/7431_2.png) [@lettierf](https://forum.inductiveautomation.com/u/lettierf)\
**Post date:** [July 24, 2018, 3:07pm UTC](https://forum.inductiveautomation.com/t/move-tag-by-script/18947/3 "2018-07-24T15:07:45Z")

</div>

ok. So the solution I am using now is the only one that is possible. Thank you for the reply

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [July 24, 2018, 3:51pm UTC](https://forum.inductiveautomation.com/t/move-tag-by-script/18947/4 "2018-07-24T15:51:19Z")

</div>

You can get this functionality using system.tag.browseConfiguration and system.tag.configure.

Here is a very hard coded example. It might be easier to convert the TagConfigSet to JSON and deal with it that way, but this works for your example.

```auto
t = system.tag.browseConfiguration("temp",True)
print t[0].properties

for p in t[0].properties:
	if p.name == "path":
		break
	else:
		p = None

op = t[0].fullPath
if p is not None:
	t[0].set(p,"")
	
print t.toJSON()
system.tag.configure(path = "",tags=t,collisionMode = "Abort")
system.tag.removeTag(op)

```

---

<div class="post-metadata">

**Author:** ![lettierf](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lettierf/32/7431_2.png) [@lettierf](https://forum.inductiveautomation.com/u/lettierf)\
**Post date:** [July 28, 2018, 1:17pm UTC](https://forum.inductiveautomation.com/t/move-tag-by-script/18947/5 "2018-07-28T13:17:03Z")

</div>

Thank you Kyle but that script is not working as expected as the tag I have to move is an UDT instance. So if I run this script it will take just the first tag inside the instance and move it to the main folder

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [July 29, 2018, 4:31pm UTC](https://forum.inductiveautomation.com/t/move-tag-by-script/18947/6 "2018-07-29T16:31:54Z")

</div>

It will work, just move the udt itself, by changing its path.
