How to set field style for empty assigned_to fields on the task table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2018 05:51 AM
Hi,
Upgraded to Kingston patch 11 and now noticed that the previously blank Assigned_to fields have (empty) in them on all Task tables. I did contact Service Now support and they said that this is intentional and a fix to some previous problems. However this is annoying my users greatly, as previously the blank spaces where easy to identify, but (empty) does not really stand out from the other text. I'm aware that you can filter on the value (and have suggested this to our users as well), however they still would like to have this kind of overview simply by looking at the list view.
So I figured that there are field styles which could be helpful and have been looking into them now. However I've run into a couple issues:
- I'm unsure how to query the empty value now. For existing values the statement javascript:current.assigned_to == 'sys_id' is working fine. However neither '' nor "" or anything else I've tried to identify the reference with no value has worked for me.
- Only background-color style seems to be working for me. As when I try to use 'color' to change the text to blend it out, nothing seems to be happening. Works fine for normal fields, but not for a reference field. Is there a comprehensive list of field styles and how to use them available to us? I did try to search the Docs, but came up empty.
Any with the above would be much appreciated!
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2018 05:57 AM
Hi,
may be try https://docs.servicenow.com/bundle/london-platform-administration/page/administer/navigation-and-ui/task/t_DefineReferenceStyles.html this instead ?
As it with all task tables you would like to have the same reference.
Please mark answer helpful or correct based on the impact of the response.
Thanks
Ishan Parikh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2018 05:58 AM
Also you can have a javascript: functioname() and have a global business rule which runs and check for empty record and then set the style as needed. Not sure will that work for reference field or not though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2021 10:41 PM
Hello,
Try us use this, it will work when the field "Assigned to" is empty
javascript:current.assigned_to.nil()
Be mindful that on the field name, I didn't used the field "Assigned to" otherwise it doesn't work. I believe it is because the style doesn't apply on empty field.
Let me know if it helps