# Script help

**URL:** <https://forum.inductiveautomation.com/t/script-help/3253>\
**Category:** Ignition\
**Created:** [September 6, 2011, 4:26pm UTC](https://forum.inductiveautomation.com/t/script-help/3253 "2011-09-06T16:26:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jac](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jac](https://forum.inductiveautomation.com/u/jac)\
**Post date:** [September 6, 2011, 4:26pm UTC](https://forum.inductiveautomation.com/t/script-help/3253/1 "2011-09-06T16:26:26Z")

</div>

A little help please with some syntax.

I can change the color of a tank liquid with the following expression in a “Dynamic Property” I set up fine.  
{Machine/IO/T1\_Level}\<{Machine/IO/T1\_BathTrigger}  
BuT I now want have the tank in a container and change the “TankNum” property that container to change the Tag for easy copying. But the syntax is driving me nutz.

I have something like this in the Property Expression.  
(Tag(“Machine/IO/T”+{Root Container.Container 1.TankNum}+"\_Level")) \< (Tag(“Machine/IO/T”+{Root Container.Container 1.TankNum}+"\_BathTrigger"))

Thanx

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [September 6, 2011, 5:15pm UTC](https://forum.inductiveautomation.com/t/script-help/3253/2 "2011-09-06T17:15:50Z")

</div>

You have the right syntax for the tag function. However, when you want to use the \< operator it expects that both arguments are numeric. The tag function returns an object so we need to cast it to an integer or float:`toInt(Tag("Machine/IO/T"+{Root Container.Container 1.TankNum}+"_Level")) < toInt(Tag("Machine/IO/T"+{Root Container.Container 1.TankNum}+"_BathTrigger"))`

---

<div class="post-metadata">

**Author:** ![jac](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jac](https://forum.inductiveautomation.com/u/jac)\
**Post date:** [September 6, 2011, 5:30pm UTC](https://forum.inductiveautomation.com/t/script-help/3253/3 "2011-09-06T17:30:25Z")

</div>

Perfect!

Thanks Travis
