cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Can I reuse the Value parameter in State Based Formating?

anatapov
1-Newbie

Can I reuse the Value parameter in State Based Formating?

Hello. I am trying to achieve the following result:

If value is 0, then display "None", otherwise display the value number (so if value is 10, display "10").

I can do it through services, but I was wondering whether I could do it only through a State Definition. Like maybe an expression that evaluates to the Value when it's put into Display Name field?

4 REPLIES 4

And making the widget visible/invisible?

No, the widget remains visible. I'd just like to have a Label that displays "None" or a number other than 0, depending on the input.

Aanjan
9-Granite
(To:anatapov)

Arseni, would using a ValueDisplay widget make sense? For the ValueFormat field, you can set state-based formatting for that. For the styles, you can potentially create a style to be displayed when the value is 0, and use one for all others.

Hi Arseni,

You have two options

  • Two labels, one with none, and the other with the value, and show/hide each one depending on the value
  • Expression Widget which formats the value ( value==0?"None":value.toFixed(2) )
Top Tags