# Expressions Working in Creator But Not on Watch?

I’m a bit confused. I’ve used expressions to control transparency on colour layers for my battery and step icons. In the creator they seem to work properly, but on my watch they’re not working. Am I doing something dumb?

This watch:

For the step counter I have the red layer at 100% permanently and stacked below layers for yellow and green:
Yellow:
\$#ZSC#>4000?100:#ZSC#/40\$
Green:
\$#ZSC#<4000?0:\$\$#ZSC#>8000?100:(#ZSC#-4000)/40\$

For the battery meter I have the green layer at 100% permanently, stacked below layers for yellow and red:
Yellow:
\$#BLN#>50?(100-#BLN#)*2:100\$
Red:
\$#BLN#<=10?100:\$\$#BLN#<=50?100+(((10-#BLN#)/4)*10):0\$

No help guys?

Hi @taz,

I am not sure,however I use always only one \$…\$ formula for a field and maybe in this expression

\$#BLN#<=10?100:\$

I would use “0” to be clear like this

\$#BLN#<=10?100:0\$

1 Like

Ah - maybe I have misunderstood the syntax for nesting the IF/THEN statements?

`\$#BLN#<=10?100:\$\$#BLN#<=50?100+(((10-#BLN#)/4)*10):0\$` was supposed to parse to

IF #BLN# <= 10 THEN 100 ELSE (IF #BLN# <= 50 THEN 100+(((10-#BLN#)/4)*10) ELSE 0

Basically trying to set a fixed value for BLN <=10, a calculated value between BLN 10 to 50, and a fixed value for BLN > 50.

It worked in Creator so I thought I had it right. How should it have been laid out?

you may be better off using a IF+(AND/OR), THEN statement:

`Red - \$#BLN#<=10?100+(((10-#BLN#)/4)*10):0\$`

`Yellow - \$#BLN#>10&&#BLN#<50?100:0\$`

2 Likes

@eradicator09 Thanks for the suggestion, I’ll try that.