# Tag change script "valueChanged": tag object

**URL:** <https://forum.inductiveautomation.com/t/tag-change-script-valuechanged-tag-object/65763>\
**Category:** Ignition\
**Created:** [October 27, 2022, 3:38pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-valuechanged-tag-object/65763 "2022-10-27T15:38:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gdube/32/41701_2.png) [@gdube](https://forum.inductiveautomation.com/u/gdube)\
**Post date:** [October 27, 2022, 3:38pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-valuechanged-tag-object/65763/1 "2022-10-27T15:38:39Z")

</div>

Hi guys,  
This is a "PyTagNodeWrapper", but I couldn't find anything with that name in the docs.  
Is it even supposed to be exposed to scripts?

This is just out of curiosity.  
I was trying to get to a BasicTagPath object to retrieve the tag's folder path, but it seems that system.tag.writeBlocking works with a relative path, so I didn't need it after all.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/4/64e8806b5fee1e8f76ecacabe71520945c9ba501.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:** [October 27, 2022, 3:57pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-valuechanged-tag-object/65763/2 "2022-10-27T15:57:20Z")

</div>

Don't know about the `PyTagNodeWrapper` docs.

However, if you want to check the value of the currentValue object you need to actually access the value of the Qualified Value.

```python
if currentValue.value != 0:
    #do stuff

#or this is equivelant
if currentValue.value:

```

A qualifiedValue object will never be equal to 0, so you're not actually preventing the write operation from occuring, which means that you are writing to your tag more often than you may be expecting.

---

<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:** [October 27, 2022, 4:19pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-valuechanged-tag-object/65763/3 "2022-10-27T16:19:20Z")

</div>

The `PyTagNodeWrapper` is, as the name implies, a "wrapper" class that just makes things a bit more ergonomic to use from Python.

In this case, it's a wrapper around a `TagNode` class, which, I think just as an oversight, _also_ isn't documented in the API. The wrapper basically gives you easier access to values inside the tag, so something like `tag.historyEnabled` should resolve.

---

<div class="post-metadata">

**Author:** ![gdube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gdube/32/41701_2.png) [@gdube](https://forum.inductiveautomation.com/u/gdube)\
**Post date:** [October 27, 2022, 4:20pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-valuechanged-tag-object/65763/4 "2022-10-27T16:20:37Z")

</div>

You're absolutely right, my mistake.  
Glad you caught it for me!

---

<div class="post-metadata">

**Author:** ![gdube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gdube/32/41701_2.png) [@gdube](https://forum.inductiveautomation.com/u/gdube)\
**Post date:** [October 27, 2022, 4:21pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-valuechanged-tag-object/65763/5 "2022-10-27T16:21:13Z")

</div>

Gotcha, thanks!
