If you’ve used ServiceNow for any length of time, you’re no doubt aware of the results of field styles.
You’ve seen bright red high priority incidents, SLAs nearing breach, and maybe a “VIP” icon, but I rarely see customers implement more than these simple ones.
As an administrator, I’ve gotten many a headache from something as simple as a business rule being disabled. Take the following list of Incident Business Rules as an example. It’s hard to call out which ones are active, and which aren’t, and this is exacerbated when you have a long list of records, or are viewing 100 at a time. You have to really be looking for them.
Here, we have a boolean (true/false) type field, so let’s try to highlight in some way the records where the Active field is “false.”
To get started, let’s open one of the Business rule records up. We’re not going to modify it, we just need easy access to the “Active” field. Once we have one open, R-click on the “Active” field, and choose “Personalize Styles.”
From here, we’re going to create a new field style. Personally, I like the background color “DarkGrey,” as it’s not a slap in the face like something like Red is.
Once you save it, we can go back to our list and test it out.
Well, that didn’t work! Why not?
Since the “Active” field is a boolean type field, the value in the database is actually “1″ or “0.” We can do one of two things here to resolve our issue.
First, we can evaluate server-side JavaScript in the Value field of our style. You see how to do this in the out-of-box VIP style:
javascript:current.caller_id.vip == true
The second (and better) option we have in this particular scenario is to simply look for the value that’s actually stored or “0″ for false.
Now, when we look at the Incident list again, we see the inactive records clearly highlighted.
Here at Cloud Sherpas, we’ve applied this technique a number of different ways and rolled some of them into what we call our Administration EXCELerator. One of the things we’ve added is highlighting based on if it’s customer “owned” (modified in some way), as opposed to an out-of-box original that’s been left untouched.
Doing this makes it really easy to come back to a script that you’re currently working on, and also serves as an indicator of items that you’ve inadvertently modified.
If you’re interested in seeing what else we’ve done or have other questions about this technique, please comment, or check out my posts on other underutilized features in ServiceNow.
The post ServiceNow Tech Tuesdays: List field styles appeared first on Cloud Sherpas.