# How to obtain tag value from Qualified Value

**URL:** <https://forum.inductiveautomation.com/t/how-to-obtain-tag-value-from-qualified-value/62089>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [July 19, 2022, 7:02pm UTC](https://forum.inductiveautomation.com/t/how-to-obtain-tag-value-from-qualified-value/62089 "2022-07-19T19:02:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [July 19, 2022, 7:02pm UTC](https://forum.inductiveautomation.com/t/how-to-obtain-tag-value-from-qualified-value/62089/1 "2022-07-19T19:02:08Z")

</div>

Can you tell me why i would be getting he “no viable input” error on this script?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/8/18f9cd06f595e9b20c128346bbf4323b69e06c7b.png)

---

<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:** [July 19, 2022, 7:10pm UTC](https://forum.inductiveautomation.com/t/how-to-obtain-tag-value-from-qualified-value/62089/2 "2022-07-19T19:10:36Z")

</div>

You are missing the closing `)` on line 2 for the `system.tag.writeAsync()` call.

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [July 19, 2022, 7:16pm UTC](https://forum.inductiveautomation.com/t/how-to-obtain-tag-value-from-qualified-value/62089/3 "2022-07-19T19:16:36Z")

</div>

yep ☹ sorry guys

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [July 19, 2022, 7:32pm UTC](https://forum.inductiveautomation.com/t/how-to-obtain-tag-value-from-qualified-value/62089/4 "2022-07-19T19:32:43Z")

</div>

In the above when I read the tag data im getting: [[0038014279, Good, Tue Jul 19 13:58:37 CDT 2022 (1658257117678)]]]

how can I only get this: 0038014279 out?  
I get the same output when i read the .value of the tag also

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 19, 2022, 7:38pm UTC](https://forum.inductiveautomation.com/t/how-to-obtain-tag-value-from-qualified-value/62089/5 "2022-07-19T19:38:23Z")

</div>

You’re requesting the tag values for a list, which is returned as a list of Qualified Values. A Qualified Value has all sorts of info including quality and the timestamp of the most recent change.  
You should modify your read to store only the value of the Qualified Value:

```auto
ID = tag[0].value

```

Edit: updated to reflect that you’re also getting a list of Qualified Values.

Relevant code:

```auto
def runAction(self, event):
	tags = system.tag.readBlocking(["[default]CylinderTag"])
	system.perspective.print("All tags: {0}".format(tags))
	system.perspective.print("QV: {0}".format(tags[0]))
	system.perspective.print("value: {0}".format(tags[0].value))		

```

Relevant output:

```auto
12:45:25.068 [Browser Thread: 60614] INFO Perspective.Designer.Workspace - All tags: [[2, Good, Thu Jul 07 18:42:50 PDT 2022 (1657244570333)]]
12:45:25.068 [Browser Thread: 60614] INFO Perspective.Designer.Workspace - QV: [2, Good, Thu Jul 07 18:42:50 PDT 2022 (1657244570333)]
12:45:25.069 [Browser Thread: 60614] INFO Perspective.Designer.Workspace - value: 2

```

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [July 19, 2022, 7:57pm UTC](https://forum.inductiveautomation.com/t/how-to-obtain-tag-value-from-qualified-value/62089/6 "2022-07-19T19:57:59Z")

</div>

Thanks that helped!
