Type casting tags to compare in expression binding

See this for properly formatting code:

this is not doing what you think it is doing. You are trying to convert a string to an integer.

{Root Container.TagPath} will resolve to some string path, which will then concatenate to the other string.

Essentially your expression looks like this:

if(toInteger("path/to/tagA" + "/Metering/TAP_POSITION") = 16,"[default]Bluestone/86B1/OP_ST 1","[defalut]Blueston/86B1/OP_ST 2") 

Instead, create a custom property on the window, perhaps the Root Container, and use an indirect tag binding to get the actual value of TagA. Same thing for TagB, and Tag C if what you want is the value of the tags and not the paths.

Then use the expression like this:

if(toInteger({Tag.A.Property}) = 16, {Tag.B.Property},{Tag.C.Property})

Honestly, there might be a better way, but I don't know exactly what you end goal is here. Also, since TagA is a short and it can hold the value 16, there is no need for it to be converted to an integer. So really the toInteger() expression is unneeded.

2 Likes