# Setting Quality on an Expression Tag

**URL:** <https://forum.inductiveautomation.com/t/setting-quality-on-an-expression-tag/43032>\
**Category:** Ignition\
**Created:** [February 4, 2021, 7:20pm UTC](https://forum.inductiveautomation.com/t/setting-quality-on-an-expression-tag/43032 "2021-02-04T19:20:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamad.tayara](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mohamad.tayara](https://forum.inductiveautomation.com/u/mohamad.tayara)\
**Post date:** [February 4, 2021, 7:20pm UTC](https://forum.inductiveautomation.com/t/setting-quality-on-an-expression-tag/43032/1 "2021-02-04T19:20:05Z")

</div>

Hi,  
I am trying to set the quality of an expression tag that uses the runscript expression function without success, getting the following error: Nesting qualified values.

 ![2021-02-04 14_08_26-Window](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/f/cfb80d49b713f0413b3fb4676d03eba99eacdcc4.png)  
How to return a qualified value with the runscript expression function?  
Thanks in advance!

---

<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:** [February 4, 2021, 7:38pm UTC](https://forum.inductiveautomation.com/t/setting-quality-on-an-expression-tag/43032/2 "2021-02-04T19:38:06Z")

</div>

You could wrap the return value in a [`forceQuality`](https://docs.inductiveautomation.com/display/DOC81/forceQuality) expression to set the desired quality?

---

<div class="post-metadata">

**Author:** ![mohamad.tayara](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mohamad.tayara](https://forum.inductiveautomation.com/u/mohamad.tayara)\
**Post date:** [February 4, 2021, 9:13pm UTC](https://forum.inductiveautomation.com/t/setting-quality-on-an-expression-tag/43032/3 "2021-02-04T21:13:22Z")

</div>

Hi Paul, The quality is calculated in the expression( dynamic, in the example it was constant for testing purposes) how to expose/use the calculated quality value in the expression with the forcequality function?  
Thanks

---

<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:** [February 5, 2021, 12:45am UTC](https://forum.inductiveautomation.com/t/setting-quality-on-an-expression-tag/43032/4 "2021-02-05T00:45:05Z")

</div>

Hmm, that’s a good question. The expression language is unfortunately bad at dealing with multiple return values…  
I do see what needs to be fixed on our side in the code, but I don’t see any immediately obvious workarounds. I’m going to file a ticket to fix things, but keep thinking about a possible solution.

---

<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:** [February 5, 2021, 12:50am UTC](https://forum.inductiveautomation.com/t/setting-quality-on-an-expression-tag/43032/5 "2021-02-05T00:50:25Z")

</div>

It’s far from ideal, but you could have your project script write the return value and a quality code integer back to _two_ tags in your UDT (manually, via `system.tag.write`) then make a new expression tag that collates them together via `forceQuality`…
