how to change the color of the field based on its state

pavankumark
Giga Contributor
 
1 ACCEPTED SOLUTION

Adarsh3003
Giga Guru

Hi @pavankumark 

 

To change the color of a field based on its state in ServiceNow, you have a few options:

  1. Client Scripts:

    • Use client scripts to dynamically modify the field’s properties based on the state.
    • For example, you can write a client script that triggers when the state changes and sets the field’s background color accordingly.
  2. Field Styles:

  3. For client script please refer below youtube link...
  4. Change background color of any field in ServiceNow explained in detail by Uday Gadiparthi (youtube.c...

 

 

 

If this is helpful for you, Please mark Helpful and Correct solution


Thanks & Regards
Adarsh Verma

View solution in original post

3 REPLIES 3

SanjivMeher
Kilo Patron
Kilo Patron

You can use field style for this. Right click on the field where you want to set the style and click field style. 

SanjivMeher_0-1717693161514.png

 

Add you condition when the field style should apply and the color you want to apply.

SanjivMeher_1-1717693217288.png

 

https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/navigation-a...

 


Please mark this response as correct or helpful if it assisted you with your question.

but its displaying only in list view i need that background color should apply to the filed in record view too how can i configure it

Adarsh3003
Giga Guru

Hi @pavankumark 

 

To change the color of a field based on its state in ServiceNow, you have a few options:

  1. Client Scripts:

    • Use client scripts to dynamically modify the field’s properties based on the state.
    • For example, you can write a client script that triggers when the state changes and sets the field’s background color accordingly.
  2. Field Styles:

  3. For client script please refer below youtube link...
  4. Change background color of any field in ServiceNow explained in detail by Uday Gadiparthi (youtube.c...

 

 

 

If this is helpful for you, Please mark Helpful and Correct solution


Thanks & Regards
Adarsh Verma