Skip to main content
1-Visitor
February 25, 2019
Solved

State-Based formatting with DATETIME data

  • February 25, 2019
  • 1 reply
  • 1597 views

is it possible to use State-Based formatting in the mashup to change the view of a datetime object.

 

For instance I would like to 

Display in Red a last checkin value of greater than an hour ago.

Display in Red a last checkin value of less than an hour ago

Best answer by CarlesColl

I think it's totally possible.

 

You should use a ValueDisplay widget, and bind to it the DATETIME value, but the trick it's that DATETIME value should come from an Infotable result type of a service, that infotable should have just one row for instance (that way you can use the All Data binding and you don't need to trigger a selected row) and at least two columns:

  • One column the DATETIME value
  • Another Column for instance you can have the Minutes between now and the DATETIME Value (you build it at server side)

That way, when you will enter on the ValueDisplay ValueFormat on the State-based formatting you will get all the previous Infotable columns in order to do the rule, and you can rule with the Minutes column which it's a Number value.

 

Best Regards,

Carles.

1 reply

5-Regular Member
February 26, 2019

Hello.

 

There's not an out of the box method for this. You could try creating a custom .css or state definitions depending on the widget(s) you need to change. You might try something with the epoch time and state definitions. 

 

We may need to know a bit more about where the display changes would be to better answer this.

 

Thanks,

 

-- Craig A.

1-Visitor
February 27, 2019

I think it's totally possible.

 

You should use a ValueDisplay widget, and bind to it the DATETIME value, but the trick it's that DATETIME value should come from an Infotable result type of a service, that infotable should have just one row for instance (that way you can use the All Data binding and you don't need to trigger a selected row) and at least two columns:

  • One column the DATETIME value
  • Another Column for instance you can have the Minutes between now and the DATETIME Value (you build it at server side)

That way, when you will enter on the ValueDisplay ValueFormat on the State-based formatting you will get all the previous Infotable columns in order to do the rule, and you can rule with the Minutes column which it's a Number value.

 

Best Regards,

Carles.

Support
March 4, 2019

Hi @pablitorun.

 

If one of the previous responses helped to solve your issue, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon