# Quality code in script

**URL:** <https://forum.inductiveautomation.com/t/quality-code-in-script/3169>\
**Category:** Archived Topics\
**Created:** [August 10, 2011, 5:36pm UTC](https://forum.inductiveautomation.com/t/quality-code-in-script/3169 "2011-08-10T17:36:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [August 10, 2011, 5:36pm UTC](https://forum.inductiveautomation.com/t/quality-code-in-script/3169/1 "2011-08-10T17:36:22Z")

</div>

how do you check the current quality code in a FactorySQL script? i want to do something like the following

```auto
if({quality_code}=192
     ,do this
     ,do that
)
```

thank you,

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [August 10, 2011, 8:05pm UTC](https://forum.inductiveautomation.com/t/quality-code-in-script/3169/2 "2011-08-10T20:05:22Z")

</div>

Using the super-secret syntax:

```auto
toInt({Tag.DataIntegrity})
```

Shouldn’t be a secret, but alas.

Regards,

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [August 10, 2011, 8:16pm UTC](https://forum.inductiveautomation.com/t/quality-code-in-script/3169/3 "2011-08-10T20:16:15Z")

</div>

thanks, but i receive this when i try it.

![](https://us1.discourse-cdn.com/inductiveautomation/original/1X/cf45ca307bd38367d47ef302995424f1ab14f19f.JPG)

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [August 10, 2011, 9:40pm UTC](https://forum.inductiveautomation.com/t/quality-code-in-script/3169/4 "2011-08-10T21:40:41Z")

</div>

Sorry, I wasn’t clear. It’s not literally “Tag”, but whatever the tag is that you want to reference. In other words, create a reference to a tag as you normally would, like:  
{MySuperValue}

and this add “.DataIntegrity” to the path:  
{MySuperValue.DataIntegrity}

Regards,
