# How to check History Enabled or not for tags using system.tag.browse?

**URL:** <https://forum.inductiveautomation.com/t/how-to-check-history-enabled-or-not-for-tags-using-system-tag-browse/71633>\
**Category:** Ignition\
**Created:** [March 27, 2023, 1:15pm UTC](https://forum.inductiveautomation.com/t/how-to-check-history-enabled-or-not-for-tags-using-system-tag-browse/71633 "2023-03-27T13:15:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 27, 2023, 1:15pm UTC](https://forum.inductiveautomation.com/t/how-to-check-history-enabled-or-not-for-tags-using-system-tag-browse/71633/1 "2023-03-27T13:15:48Z")

</div>

Hi I tired this

```auto
rootNodePath = 'test/path'
filterDict= {"tagType":"AtomicTag","recursive":True}

for result in system.tag.browse(rootNodePath, filterDict):
	print result

```

It doesn't showing History enabled or not for a tag

how to get that?

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [March 27, 2023, 1:50pm UTC](https://forum.inductiveautomation.com/t/how-to-check-history-enabled-or-not-for-tags-using-system-tag-browse/71633/2 "2023-03-27T13:50:13Z")

</div>

Doesn't **system.tag.browseHistoricalTags()** cover your needs?  
[https://docs.inductiveautomation.com/display/DOC81/system.tag.browseHistoricalTags](https://docs.inductiveautomation.com/display/DOC81/system.tag.browseHistoricalTags)

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 27, 2023, 2:00pm UTC](https://forum.inductiveautomation.com/t/how-to-check-history-enabled-or-not-for-tags-using-system-tag-browse/71633/3 "2023-03-27T14:00:38Z")

</div>

Hi noo its not returning history enabled or not

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 27, 2023, 2:31pm UTC](https://forum.inductiveautomation.com/t/how-to-check-history-enabled-or-not-for-tags-using-system-tag-browse/71633/4 "2023-03-27T14:31:34Z")

</div>

`system.tag.browse()` returns a list of nodes at the given path.  
`system.tag.browseHistoricalTags()` will return only historical tags found at a given path (that means that history is enabled on all of them)

When you want to read a specific property, just use `system.tag.readBlocking()` with the property appended to the end of the tag paths.

```auto
system.tag.readBlocking(['test/path.historyEnabled'])[0].value

```

Of course you can combine this with `system.tag.browse()`

```auto
rootNodePath = 'test/path'
filterDict = {'tagType':'AtomicTag','recursive':True}
for tag in [system.tag.readBlocking([str(result['fullPath']) + '.historyEnabled' for result in system.tag.browse(rootNodePath, filterDict).getResults()]):
    print tag.value

```

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 27, 2023, 2:45pm UTC](https://forum.inductiveautomation.com/t/how-to-check-history-enabled-or-not-for-tags-using-system-tag-browse/71633/5 "2023-03-27T14:45:58Z")

</div>

> [@lrose](#):
>
> ```auto
> for tag in [system.tag.readBlocking([str(result['fullPath']) + '.historyEnabled' for result in system.tag.browse(rootNodePath, filterDict).getResults()]):
> 
> ```

Thanks this is the line exactly i am looking  
**for tag in [system.tag.readBlocking([str(result['fullPath']) + '.historyEnabled' for result in system.tag.browse(rootNodePath, filterDict).getResults()]):**

It works very fast compare to system.tag.readBlocking(['test/path.historyEnabled'])[0].value this one

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 27, 2023, 2:53pm UTC](https://forum.inductiveautomation.com/t/how-to-check-history-enabled-or-not-for-tags-using-system-tag-browse/71633/6 "2023-03-27T14:53:34Z")

</div>

One doubt i want to get the full tag path which are not history enabled

```auto
for tag in [system.tag.readBlocking([str(result['fullPath']) + '.historyEnabled' for result in system.tag.browse(rootNodePath, filterDict).getResults()])
     print result(['fullPath'])

```

But its not returning right tag path

something to change in script?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 27, 2023, 3:21pm UTC](https://forum.inductiveautomation.com/t/how-to-check-history-enabled-or-not-for-tags-using-system-tag-browse/71633/7 "2023-03-27T15:21:30Z")

</div>

In the script you provided, the line `print result(['fullPath'])` is not valid.

You would need to do something like this instead:

```python
rootNodePath = 'test/path'
filterDict = {'tagType':'AtomicTag','recursive':True}

paths = [str(result['fullPath']) for result in system.tag.browse(rootNodePath,filterDict).getResults()]
qVs = system.tag.readBlocking([path + '.historyEnabled' for path in paths])

for path,qv in zip(paths,values):
    if qv.value:
        print path

```
