# Help with system.tag.addTag

**URL:** <https://forum.inductiveautomation.com/t/help-with-system-tag-addtag/9702>\
**Category:** Ignition\
**Created:** [February 12, 2015, 7:27pm UTC](https://forum.inductiveautomation.com/t/help-with-system-tag-addtag/9702 "2015-02-12T19:27:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim/32/3361_2.png) [@Tim](https://forum.inductiveautomation.com/u/Tim)\
**Post date:** [February 12, 2015, 7:27pm UTC](https://forum.inductiveautomation.com/t/help-with-system-tag-addtag/9702/1 "2015-02-12T19:27:54Z")

</div>

Does anyone have an example adding a tag with history using system.tag.addTag?

---

<div class="post-metadata">

**Author:** ![Paolo.Mariani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paolo.mariani/32/3285_2.png) [@Paolo.Mariani](https://forum.inductiveautomation.com/u/Paolo.Mariani)\
**Post date:** [February 13, 2015, 1:06am UTC](https://forum.inductiveautomation.com/t/help-with-system-tag-addtag/9702/2 "2015-02-13T01:06:46Z")

</div>

Yea, it would look something like this:

system.tag.addTag(parentPath="", name=“Tag2”, tagType=“MEMORY”,  
dataType=“Int2”, value=25, attributes={“HistoryEnabled”:“TRUE”, “PrimaryHistoryProvider”:“DB”})

All of the history settings would go in the "attributes section of the parmeters. Also below is a link to a scripting functions manual, and if you go to system.tag.addTag, in the parameters section next to attributes, there will be a link for Tag Attributes, that will provide a list of all the possible attributes for a tag. Just note that the attributes for the alarms should go into the alarmConfig parameter.

[files.inductiveautomation.com/mo … index.html](http://files.inductiveautomation.com/modulemarket/1/46/version/121/doc/index.html)

---

<div class="post-metadata">

**Author:** ![Tim](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim/32/3361_2.png) [@Tim](https://forum.inductiveautomation.com/u/Tim)\
**Post date:** [February 13, 2015, 2:59pm UTC](https://forum.inductiveautomation.com/t/help-with-system-tag-addtag/9702/3 "2015-02-13T14:59:52Z")

</div>

Got it. Thanks

```auto
system.tag.addTag(parentPath="Folder", name="Test", tagType="MEMORY", dataType="Boolean", value=0, attributes={"HistoryEnabled":"TRUE", "PrimaryHistoryProvider":"DB", "HistoricalScanclass":"<Evaluate On Change>","HistoricalDeadband":"1.0", "InterpolationMode":"2"})
```

---

<div class="post-metadata">

**Author:** ![anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@anna](https://forum.inductiveautomation.com/u/anna)\
**Post date:** [May 28, 2015, 4:42pm UTC](https://forum.inductiveautomation.com/t/help-with-system-tag-addtag/9702/4 "2015-05-28T16:42:24Z")

</div>

An important note: do NOT specify the Historical Scan class as “” - it should be stored as an empty string to achieve that:

```auto
system.tag.addTag(parentPath="Folder", name="Test", tagType="MEMORY", dataType="Boolean", value=0, attributes={"HistoryEnabled":"TRUE", "PrimaryHistoryProvider":"DB", "HistoricalScanclass":"", "HistoricalDeadband":"1.0", "InterpolationMode":"2"})
```

---

<div class="post-metadata">

**Author:** ![jacque\_trahan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jacque_trahan/32/58886_2.png) [@jacque\_trahan](https://forum.inductiveautomation.com/u/jacque_trahan)\
**Post date:** [February 13, 2023, 4:29pm UTC](https://forum.inductiveautomation.com/t/help-with-system-tag-addtag/9702/5 "2023-02-13T16:29:28Z")

</div>

I was looking for the documentation on this and was able to find it [here](https://docs.inductiveautomation.com/display/DOC79/system.tag.addTag) but could not find it on version [8.1 scripting function's docs](https://docs.inductiveautomation.com/display/DOC81/System+Functions).

Is this function on a plan to be deprecated?

---

<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:** [February 13, 2023, 4:36pm UTC](https://forum.inductiveautomation.com/t/help-with-system-tag-addtag/9702/6 "2023-02-13T16:36:15Z")

</div>

`system.tag.addTag` _is_ already deprecated. However, with extremely rare exceptions, Ignition's "deprecation" of a scripting function just means it's no longer recommended for use and will be hidden from autocomplete/documentation. The "legacy" function call will continue to work.

That aside, in a _new_ project there's zero reason to use `system.tag.addTag`. [`system.tag.configure`](https://docs.inductiveautomation.com/display/DOC81/system.tag.configure) is the new alternative, and it's significantly more powerful.
