Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Color Format for Field on UI Component (Dashboard)

SwapnilC
Tera Contributor

How to highlight a field based on a condition in the UI Builder component (to be visible on the dashboard).

I have a component on task_sla table which filters by type is incident and incident is active. I want the task field to be coloured (fomatted in some way) so that the desk is aware on what action to take based on color. The condition is:

If business_percentage > 50 && current.business_percentage < 100 then style the task field as Orange.

If business_percentage >= 100 then style the task field as Red.

 

 

I have completed the task on the list view of task_sla table. Created 3 styles on this table with value/ condition as:
1. Value - javascript&colon;current.business_percentage > 50 && current.business_percentage < 100
Style - background-color: orange;

 

2. Value - javascript&colon;current.business_percentage >= 100
Style - background-color: red;

 

3. Value - javascript&colon;current.task.needs_attention==true
Style - background-color: blue;


This works perfectly on the task_sla list table. The field number changes its colour (see small red and orange circle along with the task number) as per the business percentage as below(used modern colour cell) :

 

SwapnilC_0-1749735482079.png

 

 

I want the same to be done on the components that can be seen in the dashboard ~ UI Builder. How to do this?

SwapnilC_1-1749735715661.png

 

0 REPLIES 0