Skip to main content
5-Regular Member
August 23, 2021
Solved

How to apply state-based formatting using a setpoint as reference?

  • August 23, 2021
  • 2 replies
  • 2621 views

Hello amigos,

 

I'm a noob in Thingworxs and Im trying to color a grid cell (variable value) using as reference his setpoint.

Does anyone know how to do it? Formatting just allows numbers, or Is it possible pass a variable name as value? 

 

Thank you in advance masters!

Best answer by BogdanM

Limits for numeric states are only literal values when you create them using the state definitions ui. You can try the following alternatives:

  1. If you are using the advanced grid widget, you can specify a runtime configuration via the Configuration property where you can define the state formatting limits within a service. This capability isn't well documented, but you can find some good examples in the entities provided in this help article.
  2. You can add an additional string column and calculate its value in the service you use to populate your grid, based on the value of number properties. This column could take values like GreenYellow and Red. Then, when you configure your grid, you can hide this column but you can use it as the dependent field for your numeric column and just use a string-based state formatting. The community post linked by @bchaudhary_448008 explains this approach.

 

2 replies

5-Regular Member
August 25, 2021

Hi @AZ_10002866 , 

As per my understanding you are planning to colour only a single grid cell i.e. reference point.

 

Regards

Bhawna

5-Regular Member
August 25, 2021

Yes, example, Speed(random variable) should colored base on < 50 green (SpeedSetPoint), < 75 yellow (SpeedSetPoint * 1.5), the rest should be red. 

The control limits should take the variable SetPoint instead direct number, in order to, when the SetPoint changes the color boundaries change too.

5-Regular Member
August 26, 2021

Hi @AZ_10002866 , 

You can do that by doing state formatting. In that different styles can be applied on the basis of given conditions.

Attaching the reference document for further clarification.

state formatting and styling  

2 

Regards

Bhawna

BogdanM1-VisitorAnswer
1-Visitor
August 27, 2021

Limits for numeric states are only literal values when you create them using the state definitions ui. You can try the following alternatives:

  1. If you are using the advanced grid widget, you can specify a runtime configuration via the Configuration property where you can define the state formatting limits within a service. This capability isn't well documented, but you can find some good examples in the entities provided in this help article.
  2. You can add an additional string column and calculate its value in the service you use to populate your grid, based on the value of number properties. This column could take values like GreenYellow and Red. Then, when you configure your grid, you can hide this column but you can use it as the dependent field for your numeric column and just use a string-based state formatting. The community post linked by @bchaudhary_448008 explains this approach.