How to control list view field color attributes based on Priority of the record

kksnow
Kilo Contributor

On the HR list layout we see the SLA (percent) color coded bar, this field is a percent_type field with the attributes to control colors in varying percentages.

My requirement is to have a different set of color scheme for different type of priority/SLA.

For example the High Priority 25% should be orange and the Critical should be Red on 25%

hr_list.jpg

Is this possible in the list view? And how can we do this?

Any answers/advise is appreciated.

4 REPLIES 4

Chuck Tomasi
Tera Patron

Hi Kris,



Take a look at Field Styles.



Defining Field Styles - ServiceNow Wiki



For the "value" field, you can put in a scripted result like this:



javascript:colorCheck(current);



and create a script include that calculates a true/false value. Here's a recent example I helped someone on.



Trying to get Red Dot next to Incident in My Work if it is a Parent Incident



For your case, you are going to need a new field style for each color you want, but should be able to call the same colorCheck() function to determine which ones to turn on and off.


Thank you Chuck. I will try.


The suggestion provided gave us the alternate way of solution which made me create an additional custom field.



But can we dynamically change the field attributes below ?



CaptureXYZ.JPG



Once again thank you Chuck, I like all your Videos


Kris


Thank you Kris for the kind words.



Attributes are not dynamically settable for percentage complete. My dynamic solution was for the Priority field, not the values in the SLA percentage field. Sorry for the confusion.