# Please help with code read tag

**URL:** <https://forum.inductiveautomation.com/t/please-help-with-code-read-tag/33302>\
**Category:** Ignition\
**Created:** [March 22, 2020, 8:33pm UTC](https://forum.inductiveautomation.com/t/please-help-with-code-read-tag/33302 "2020-03-22T20:33:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![etlikmilos](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@etlikmilos](https://forum.inductiveautomation.com/u/etlikmilos)\
**Post date:** [March 22, 2020, 8:33pm UTC](https://forum.inductiveautomation.com/t/please-help-with-code-read-tag/33302/1 "2020-03-22T20:33:45Z")

</div>

Hi all  
Sorry for my stupid question but i am beginner.  
Please i have script code for read tag and query task.  
But when I want read tag for query task doesn’t work it ☹  
So this code id OK and functional :

```auto
	dataA= {'barcode': 'A0001',
			'where': 'A0'
		}
	
	query = system.db.runNamedQuery("Technic","technics/searchID/searchID",dataA).getValueAt(0,0)
	self.getSibling("Label").props.text = query

```

But when I want read dataA from tag query it does not work ☹

```auto
	dataA= {'barcode': system.tag.readBlocking(["[default]adapter/StartBarCode"])[0],
			'where': system.tag.readBlocking(["[default]adapter/barCode"])[0]
		}
	
	
	query = system.db.runNamedQuery("Technic","technics/searchID/searchID",dataA).getValueAt(0,0)
	self.getSibling("Label").props.text = query

```

---

<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:** [March 23, 2020, 3:36pm UTC](https://forum.inductiveautomation.com/t/please-help-with-code-read-tag/33302/2 "2020-03-23T15:36:36Z")

</div>

You need to extract the value property - [`system.tag.readBlocking`](https://docs.inductiveautomation.com/display/DOC80/system.tag.readBlocking) returns a list of [`QualifiedValue`](https://docs.inductiveautomation.com/display/DOC80/Q#qualifiedvalue) objects, from which you can extract the value, quality, or timestamp of the value.

```auto
values = system.tag.readBlocking(["[default]adapter/StartBarCode", "[default]adapter/barCode"])
barcode = values[0].value
where = values[1].value

# Alternate syntax, a bit more efficient:
# barcode, where = [qv.value for qv in system.tag.readBlocking(["[default]adapter/StartBarCode", "[default]adapter/barCode"])]

dataA= {'barcode': barcode, 'where': where}

query = system.db.runNamedQuery("Technic","technics/searchID/searchID",dataA).getValueAt(0,0)
self.getSibling("Label").props.text = query

```

---

<div class="post-metadata">

**Author:** ![etlikmilos](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@etlikmilos](https://forum.inductiveautomation.com/u/etlikmilos)\
**Post date:** [March 24, 2020, 6:32am UTC](https://forum.inductiveautomation.com/t/please-help-with-code-read-tag/33302/3 "2020-03-24T06:32:26Z")

</div>

Thank you 😃
