# System.tag.configure change folder to tag

**URL:** <https://forum.inductiveautomation.com/t/system-tag-configure-change-folder-to-tag/34583>\
**Category:** Ignition\
**Created:** [May 8, 2020, 5:21pm UTC](https://forum.inductiveautomation.com/t/system-tag-configure-change-folder-to-tag/34583 "2020-05-08T17:21:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [May 8, 2020, 5:21pm UTC](https://forum.inductiveautomation.com/t/system-tag-configure-change-folder-to-tag/34583/1 "2020-05-08T17:21:57Z")

</div>

I am trying to turn a folder in tags to a String tag using system.tag.configure. system.tag.configure is returning Good, but the tag just stays as a folder. I am I missing something?

I have a folder at with nothing “[tagProvider]myFolder” in it. I then run the following and nothing happens with the tag but it returns Good

```auto
tag = {
		"name": "state",
		"valueSource": "memory",
		"dataType": "String",
		"tagType": "AtomicTag",
		"value": "myTestString"
}

system.tag.configure(basePath = "[tagProvider]myFolder", tags = [tag], collisionPolicy = "m")

```

The strange thing is that if i then run system.tag.getConfiguration I can see the configuration has changed, but the tag still looks like a folder in the browser tree.

refreshing or restarting the tags does not change anything, but if I go to the gateway page and got to the tag provider and edit and save it the tag will then change from a folder to a string tag.

version 8.0.12

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [May 10, 2020, 7:11pm UTC](https://forum.inductiveautomation.com/t/system-tag-configure-change-folder-to-tag/34583/2 "2020-05-10T19:11:20Z")

</div>

@Jonathan

While the definition of the tag is changing, the changing the tagType from a `Folder` to an `AtomicTag` is something that the system doesn’t expect and Ignition isn’t written to handle this type of change in the manner you are looking to achieve it. In fact an error is thrown if you use `system.tag.getConfiguration` and attempt to change the `tagType` key from `Folder` to `AtomicTag` and resubmit.

The way I would advise doing this is:

1. Getting the configuration of the existing folder using `system.tag.getConfiguration`
2. Make the changes to that config, dropping the tagType key
3. Delete the tag
4. Submit the new configuration

This will leave the system in a much more predictable state. I have provided a working example below. Keep in mind that this will delete the folder (and potentially anything contained in it) before writing the new tag. You will want to add code surrounding this to ensure that a tag creation failure doesn’t lead to disastrous results for your system.

```auto
basePath = '[tagProvider]myFolder'
tagName = 'state'
tagPath = '{0}/{1}'.format(basePath, tagName)

config = system.tag.getConfiguration(tagPath)[0]

config[u'valueSource'] = u'memory'
config[u'dataType'] = u'String'
config[u'value'] = u'myTestString'
del config[u'tagType']

system.tag.deleteTags([tagPath])
system.tag.configure(basePath=basePath, tags=[config], collisionPolicy='a')

```

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [May 11, 2020, 5:14pm UTC](https://forum.inductiveautomation.com/t/system-tag-configure-change-folder-to-tag/34583/3 "2020-05-11T17:14:50Z")

</div>

Thanks, I should be able to make this work.
