Each Service Catalog variable in ServiceNow allows you to provide the end-user with some additional information about that variable and how to use it. By default, these ‘Help Text’ sections are collapsed when the service catalog item loads. You may want to automatically expand the help text for a particular variable so that it is more obvious to the user what they need to do. Here’s how you can toggle the display of the help text for variables in your service catalog.

The following script will show the help text for the ‘caller_id’ variable automatically when the catalog item form loads.
var myVar = g_form.getControl('caller_id');
toggleHelp(myVar.id);
}
Switching help text open or closed instead of a toggle
If you encounter a situation where you need to open or close the help text automatically, but don’t know what state the help text will be in, then the ‘toggleHelp’ function probably won’t work for you. This is most often the case if you need to toggle the help text based on some ‘onChange’ event. For those cases you can use the following scripts, which leverage the ‘expand/collapse’ effect functionality I wrote about.
Expand the help text for a variable (‘caller_id’)
var myVar = g_form.getControl('caller_id');
expandEffect($('help_' + myVar.id + '_wrapper'));
$('img.help_' + myVar.id + '_wrapper').src="images/filter_reveal16.gifx";
Collapse the help text for a variable (‘caller_id’)
var myVar = g_form.getControl('caller_id');
collapseEffect($('help_' + myVar.id + '_wrapper'));
$('img.help_' + myVar.id + '_wrapper').src="images/filter_hide16.gifx";
Comments
Posted On
Feb 17, 2010Posted By
AlexWorks great.. Thanks!
Posted On
Mar 23, 2011Posted By
RoxDoes anyone know how to format the help text box? I don’t want a continuous long line of text I want it to show in a list or perhaps bold some text, if anyone can help, that would be great. Thanks
Posted On
Mar 23, 2011Posted By
Mark StangerGood question. The help text boxes can be formatted with straight html. You can insert line breaks, lists, etc. just by adding the correct html code. If you’re not an html expert you can use the html editor in a knowledge article to create the look you want and then copy the code
.
Posted On
Apr 27, 2011Posted By
Daniel StyerIs there a way to tell the state of the Help field, On or Off. I would like to have the Help On when the field is blank. But, if the user toggles the Help, I can not tell what state the Help is in.
Posted On
Apr 27, 2011Posted By
Mark StangerThere is a way. I just updated the article with a method to do an expand or collapse rather than a simple toggle.
Posted On
Jun 21, 2011Posted By
AmolHI Mark,
I have created a Label field and add a help text there. this script is not working
Posted On
Jun 21, 2011Posted By
Mark StangerInteresting. It looks like label fields have a different ID format than other variables do. It should work with this script…
var myVar = g_form.getControl('YOUR_VAR_NAME_HERE');
toggleHelp(myVar.id.replace('sys_original.', ''));
}
Posted On
Jun 21, 2011Posted By
AmolMany Many Many Thanks Mark.
It worked. Gr8. Here at client site and we were searching this for so many days.
Thanks a lot Again Mark.You are a true Guru of Service Now.
Thanks
Amol Bhatt
Patni Americas Inc.