Field styles for List field

meghanareddy206
Tera Contributor

Can we create field styles for list or list collector type of fields in service now. We are trying to add field styles for watch lists. For some of the users,  it has to show them as highlighted on incident form. For this, We've implemented a custom flag on the user table and tried to add a field style for which the flag is true. The user service now test should show red color when added to watch list. Any help is appreciated. The field style works on list view but doesn't work on form view. 

 

The field style is referencing a client callable script include which looks for the flag on users.

 

find_real_file.png

 

find_real_file.png

8 REPLIES 8

ggg
Giga Guru

i have not done this before and found this very helpful:

 

https://docs.servicenow.com/bundle/madrid-platform-administration/page/administer/navigation-and-ui/task/t_DefineFieldStyles.html

ccajohnson
Kilo Sage

It appears that you are trying to dot-walk through the entries in the Watch list to see if the user record used to add to the watch list has a Billable [u_billable] checkbox checked. Unfortunately, the values of a List field only store the sys_id of the records added. Please explain the desired behavior so that we can narrow our solution accordingly.

Hi ccajohnson,

             I'm trying to highlight only specific users whose flag(u_billable) is marked as true. In servicenow, we have field styles, but no matter what condition I provide, its making entire field(all elements selected in the list) highlighted. My requirement is to make only some of them hightlight(in my case flagged elements), but not all. How can we achieve this?

You would need a Display BR and store the u_billable flag value in the scratchpad variable and make the field color change dynamically using the Client script.

https://servicenowgems.com/2016/10/10/understanding-scratchpad-g_scratchpad/

https://www.servicenowguru.com/system-ui/ui-scripts-system-ui/modifying-label-form-fields-client-scr...


Please mark my response as correct and helpful if it helped solved your question.
-Thanks