# Quickly organize tags into folders

**URL:** <https://forum.inductiveautomation.com/t/quickly-organize-tags-into-folders/88424>\
**Category:** Ignition\
**Created:** [April 5, 2024, 1:28pm UTC](https://forum.inductiveautomation.com/t/quickly-organize-tags-into-folders/88424 "2024-04-05T13:28:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_S](https://avatars.discourse-cdn.com/v4/letter/n/6a8cbe/32.png) [@Nick\_S](https://forum.inductiveautomation.com/u/Nick_S)\
**Post date:** [April 5, 2024, 1:28pm UTC](https://forum.inductiveautomation.com/t/quickly-organize-tags-into-folders/88424/1 "2024-04-05T13:28:45Z")

</div>

I was in the market for a faster way to organize tags from a bulk import and wasn't able to find an existing example.  
Manually organizing through drag and drop was very time consuming and I found out the hard way that dragging too many tags at once would lead to locking up the program. so I came up with a script to handle this.

1.) In the script console (Tools\>Script Console), paste the script below.  
2.)Change the sourceFolderPath and destinationFolderPath to your desired paths in quotes.  
3.) Change the keyword of the tags you want moved in the 'if " " in tagName:' line  
4.) Hit execute and the tags should change locations.

```auto
# Define the root folder paths
sourceFolderPath = "[default]_device 1_/UnitId xx/AllTags"
destinationFolderPath = "[default]_device 1_/UnitId xx/AllTags/Outputs"

# Get a list of all tags under the source folder
tags = system.tag.browse(sourceFolderPath)

# Iterate through the tags and move those containing "Output" in their name to the destination folder
for tag in tags:
    tagName = tag['name']
    if "Output" in tagName:
        # Move the tag to the destination folder
        tagPath = sourceFolderPath + '/' + tagName
        system.tag.move([tagPath], destinationFolderPath)

```

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 5, 2024, 1:54pm UTC](https://forum.inductiveautomation.com/t/quickly-organize-tags-into-folders/88424/2 "2024-04-05T13:54:13Z")

</div>

Please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831) and then fix your post.

---

<div class="post-metadata">

**Author:** ![Nick\_S](https://avatars.discourse-cdn.com/v4/letter/n/6a8cbe/32.png) [@Nick\_S](https://forum.inductiveautomation.com/u/Nick_S)\
**Post date:** [April 5, 2024, 1:59pm UTC](https://forum.inductiveautomation.com/t/quickly-organize-tags-into-folders/88424/3 "2024-04-05T13:59:57Z")

</div>

Got it, Thanks!
