Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How to add help-text to checkbox variable

Service Manager
Kilo Guru

Hi,

I need help to add help text to check box type variable.

Help text contain the url of another catalog item. I tried with onLoad catalog client script but it didn't work as expected.

function onLoad() {
//Type appropriate comment here, and begin script below
g_form.showFieldMsg('varaible_name','text ..............' , 'info');

}

FYI - When I tried this script I got below message.

find_real_file.png

1 ACCEPTED SOLUTION

Hi,

It seems field message doesn't allow url to be shown

can you try to do this using annotations

right click form -> configure form layout

add annotation just below the field you want to show the url; in the annotation add the url you want

Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron

Hi,

 

Is this not working now after using the above in onload? what it is showing up?

Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thanks for your response.

It is working as expected but pop-up to add system properties making me curious. 

find_real_file.png

Can you tell how to encode the url in the help text g_form.showFieldMsg('varaible_name','text ..............' , 'info');

I wanted to add the url + text 

Thanks

Hi,

can you try to update code as below; sample for example

var urlString = '<p><a class="web" target="_self" href="' + "www.google.com" + '">' + "visit" + '</a></p>';

g_form.showFieldMsg('varaible_name', url , 'info');

Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi,

I tried that code to bring the url but unfortunately, it didn't work.

Thanks