Style background-color won't apply on list when field is empty

staceyrocheleau
Kilo Guru

I've created some style entries for a field. One is set to true based on a condition of another field and these styles get applied correctly on the form view.

On the list view, if the field is empty, the style is not applied.If I view the form, it is applied.

Field: blank

Style not applied in list view (background-color)

Style applied in form view

Field: value

Style applied in list view

Style applied in form view

I really want these fields to appear greyed out on the list view. Just a side note that they are also restricted by an ACL for write access but only show as greyed out by the default style (being read only) on the form view.

The issue is that I WANT the field to be blank AND greyed out in the list view when it is read-only.

12 REPLIES 12

Dave Smith1
ServiceNow Employee
ServiceNow Employee

It's likely to be a different CSS class when in the list.



I don't know the underlying class names, but as a list the values are presented in tabular format, rather than as form fields, hence your style won't apply.


It definitely has something applying differently but not sure where. And the style gets formatted IF I put some kind of value in that field. It's not consistent between the two views. I'm wondering if anyone has developed a work around or where I can maybe override the css?


Can you post the screenshot of your condition ? I will try in my sandbox.


Simply put in a condition like this:



Table: < any table>


Field: <text field or number field>


Value: javascript: true;


Style: text-align:center;


background-color:grey;



Now view the list with empty and non-empty values. You'll see that the fields with a value show your formatting while the others don't.