Ternary Operator in text field

I am trying to use a tag expression in a text field:

(([WTHR_TEM_UNIT])==1) ? “C”: “F”

It will only display: 0 ? “C” : “F”

The first digit will be a zero or one depending on weather C or F is selected.

This tag expression works to set the opacity in the opacity field.

(([WTHR_TEM_UNIT])==1)? 100 : 50

Does the ? work in text fields?

1 Like

A lot of things are changing at the moment . Have you tried putting the whole formula in parentheses .

I will check for you when I get up .

.

I can confirm that this works exactly as you expected .

((([WTHR_TEM_UNIT])==1) ? “C”: “F”)

.

That works. Thank you.

1 Like