Changing "-- None --" in Select Box variables on catalog items

Jim Coyne
Kilo Patron

There is a feature available to change the display value of the "-- None --" option in Select Box fields on forms. Here's the Wiki article - http://wiki.service-now.com/index.php?title=Customizing_Choice_Lists#Changing_the_--_None_--_Display_Value

However, that does not work with Catalog Variables. I created a UI Script that does it for you:


function u_replaceSelectBoxNoneString(variableName, newString) {
try{
var control = g_form.getControl(variableName);
control.options[0].text = newString;
}
catch(err) {}
}


So now you can just call it from an onLoad script to change the string:

function onLoad() {
u_replaceSelectBoxNoneString('action', '-- Please Select --');
}


and you end up with:
find_real_file.png

Bonus - It actually works on forms as well.

1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

Just setting this answer as correct as the actual thread was not meant as a question and it cannot be changed because it came from the original Community site.


View solution in original post

11 REPLIES 11

Thanks!


Jim Coyne
Kilo Patron

Just setting this answer as correct as the actual thread was not meant as a question and it cannot be changed because it came from the original Community site.


Mike McCall
Giga Guru

I know it's a lot of circular linking, but in case anyone finds only this page, I think it's worth also considering UI Messages for a possible global change: Re: Changing display value of --None-- for Service Catalog variables



(I've actually only used the NULL override approach so far, so I can't speak for exactly how "global" the change really is.)


Trevor Muhl
Kilo Sage

Hello everyone,



Just to provide an update concerning this, the choice value must now be set to NULL_OVERRIDE. Choices with a value of NULL were not being properly saved, from my experience.



Reference: Change the None display value (also works on Helsinki)


Hi Trevor, seeing this post...any idea if this works for catalog items in Service Portal?