Conditional Gauger by context Variable

Hello Losant Team
I want to know if it is possible to use context variable in condiontal gauger. For example:

{{value}} < {{ctx.alarmLevelWater}}

I was reading the documentation but I can’t find the answer.

Thanks! :slight_smile:

You should be able to, assuming alarmLevelWater is a number-type context variable.

See attached; here, maxValue is a number variable with a current value of 0. Is there a place where you tried to use a variable like this and it did not work? Please let us know if so.

1 Like

Thanks for the Reply Dylan.
I have this but doens’t works. Look

Ctx are number-type
I know that the ctx are ok because i use it in another blocks and working.
wrLev = 80
alLev = 50
But the color doesn’t change

Any idea? Thanks again! :slight_smile:

There are lots of unknowns here -

  • What is the value of {{value}}?
  • Are you applying a data transformation expression? If so, {{value}} used in the conditions for changing the gauge’s color will be the result of that expression, not the raw value returned by your query (as it is when defining the data transformation expression).
  • What is the value of {{ctx.Offset}}?
  • What is the value of {{ctx.Coef}}?
1 Like

Yes, i’m applying a data Transformation
Now i understand, i thought that {{value}} always represent the raw value returned by my query.
Thanks Dylan the problem was that. i appreciate your reply :slight_smile:

Glad to hear we figured it out. I’m going to file a ticket to clarify that {{value}} is the result of the expression because of the confusion. Please let us know if you have any other questions!

1 Like

Thank Dylan! I don’t have other question. Have a nice day :slight_smile: