Background Color not displaying on form view

Thomas_J_C
Mega Expert

I've been having trouble setting the background color of a field to display when a user is on the form view. Currently, the color only displays on the list view. Don't know where I'm going wrong with this one.

Below is my condition/field and tables. Script is working fine. 

find_real_file.png

When I navigate to List View it displays the correct color. See below:

find_real_file.png

However, when I enter the Form view, the color is not displaying. Any thoughts on why this is occurring??

Form view below:

find_real_file.png

4 REPLIES 4

Mark Roethof
Tera Patron
Tera Patron

Hi there,

This has to do with the value field. If this is filled, the field style will not be applied on the form view. Without a value in the value field, you will see the field style working.
For list view this is different, this will work, also if you use the value field.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Mark Roethof
Tera Patron
Tera Patron

See also:
https://docs.servicenow.com/bundle/madrid-platform-administration/page/administer/navigation-and-ui/...

"Note: The value only affects list field styles. To apply field styles on both lists and forms, leave this field blank."

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Thomas_J_C
Mega Expert

Hi Mark, 

Below is an example of why this is confusing. The background color shows up on both the form and field view with a value script. This is exactly the same process I will need to implement.

Below is the form view:

find_real_file.png

 

Below is a screenshot of the styles for the compliance score percentage field:

find_real_file.png

So this field is showing the correct color with a value included.

Thomas_J_C
Mega Expert

Figured out an onChange client script based on OOB functionality which has worked for the form. Also kept the same values on the field to display on the list during certain conditions.

find_real_file.png