# system.tag.queryAnnotations No result?

**URL:** <https://forum.inductiveautomation.com/t/system-tag-queryannotations-no-result/91179>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 31, 2024, 1:58am UTC](https://forum.inductiveautomation.com/t/system-tag-queryannotations-no-result/91179 "2024-05-31T01:58:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [May 31, 2024, 1:58am UTC](https://forum.inductiveautomation.com/t/system-tag-queryannotations-no-result/91179/1 "2024-05-31T01:58:04Z")

</div>

![c593c128444907e30e64ab2fc5ef234](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/a/6aa20aa6c3e820679b970b8095fd4367d3649bf2.png)

 ![e24babc7606b60f673d6080a08d99e9](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/7/e7d21bf544b62475f1faa5f36a96f4800ddf15db.png)

 ![bd80d4dc7818b4fbd32b18d3d514607](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/e/eeb6d677669f7a39f005dfe5a65a25e7879d8ac7.png)

```python
paths = [u"[Laboratory]炉上温Up"]
annotations = system.tag.queryAnnotations(paths)
for i in annotations:
    print i.storageId

```

---

<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:** [May 31, 2024, 8:22am UTC](https://forum.inductiveautomation.com/t/system-tag-queryannotations-no-result/91179/2 "2024-05-31T08:22:59Z")

</div>

What is `i.storageId` supposed to return? It's not a column in the data table. Do you mean `annotationid`?

---

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [June 3, 2024, 1:37am UTC](https://forum.inductiveautomation.com/t/system-tag-queryannotations-no-result/91179/3 "2024-06-03T01:37:35Z")

</div>

```python
paths = [u"[Laboratory]炉上温Up"]
annotations = system.tag.queryAnnotations(paths)
print annotations 

```

Just print annotations is empty?  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/2/7246e6d6948c85faeffe1a68729665dcea6a5bf9.png)

---

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [June 6, 2024, 3:25am UTC](https://forum.inductiveautomation.com/t/system-tag-queryannotations-no-result/91179/4 "2024-06-06T03:25:30Z")

</div>

```python
paths = [u"histprov:Laboratory:/drv:Ignition-Win10-2022WCACW:/prov:Laboratory:/tag:TestTag222",
		 u"histprov:Laboratory:/drv:Ignition-Win10-2022WCACW:/prov:Laboratory:/tag:TestTag"]

startTime=system.date.addDays(system.date.now(), -30)
endTime = system.date.now()
types = ['note']
annotations=system.tag.queryAnnotations(paths, startTime, endTime,types)
print annotations
for item in annotations:
    print item
    print item.data

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/44515ad722561c6b24fe1529587cf64cfcde65f1.png)

```python
How to get all path in Laboratory or can filter the tag?
paths=[u'histprov:Laboratory:/drv:Ignition-Win10-2022WCACW:/prov:Laboratory:/tag:*']

```

---

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [June 7, 2024, 1:44pm UTC](https://forum.inductiveautomation.com/t/system-tag-queryannotations-no-result/91179/5 "2024-06-07T13:44:57Z")

</div>

I use system.tag.browse to filter the tag, then use system.tag.queryAnnotations .

```python
    newpath =[]
	results = system.tag.browse(path ="[Laboratory]",filter = {'name':'*炉*'})
	defaultpath ='histprov:'+self.view.custom.histprov+':/drv:'+self.view.custom.drv+':/prov:Laboratory:/tag:'
	for result in results.getResults():
		itemPath = str(defaultpath+str(result['fullPath']).split(']')[1]).decode()
		newpath.append(itemPath)
	
	startTime=system.date.parse(self.view.params.startDT, 'yyyy-MM-dd HH:mm:ss','en')
	endTime=system.date.parse(endTime, 'yyyy-MM-dd HH:mm:ss','en')
	types = ['note']
	annotations=system.tag.queryAnnotations(newpath, startTime, endTime,types)

```
