- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2020 10:44 PM
Hello,
I want to show help text based value selected in a previous variable.
Variable1 -> Yes/No
Variable2.
If Variable1 is set as YES then the help text of Varible2 should be "Test 1".
If Variable1 is set as NO then the help text Variable2 should be "Test 2".
I have created a UI policy and in script I use g_form.showFieldMsg.
But whenever I change the value in Variable1 the both the help text are displaying one down the another. Help text is not getting cleared based on the value selected.
Best Regards,
Ram
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2020 10:47 PM
Hi,
you cannot set dynamic help text directly
if you are using showFieldMsg then just when your onchange client script starts you need to hide the field message using hideFieldMsg
you should use client script when scripting is involved
please share your script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2020 10:47 PM
Hi
In order to change the variable help text you need DOM manipulation which is not recommended. Instead if you have to do please refer to the below link:
Updating variable help text dynamically?
If I have answered your question, please mark my response as correct and helpful so that this thread can be closed and others can be benefited by this.
Thank you very much
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2020 10:47 PM
Hi,
you cannot set dynamic help text directly
if you are using showFieldMsg then just when your onchange client script starts you need to hide the field message using hideFieldMsg
you should use client script when scripting is involved
please share your script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2020 11:17 PM
Thanks Ankur.
just another quick question. is it possible to bring a line to next line within using showFieldMsg?
Best Regards,
Ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2020 11:55 PM
Hi,
you can try to use \n character
var message = 'message1\nmessage2';
g_form.showFieldMsg('variable', message,'info');
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader