help text (label variable) is not visible on the service portal based on the drop down changes ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2024 10:22 AM
Hi All,
I have a urgent Requirement, Help text (label variable) is not Visible on service portal based on drop down changes,
Example : I have drop down variable in service catalog, in drop down x and y choices when i am selecting x, (label variable) help text is should be not visible , when i am selecting the y help text should be visible on service portal and itil view also, but it's not working as excepted
I have written on change catalog script :
Can you please correct me anyone, please help me on this .
thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2024 03:11 PM
Hi @karishma shaik ,
Use g_form_getField("<fieldname>").placeholder to change the example text dynamically in a portal.
Use g_form.getControl("<fieldname>").placeholder to change the example text dynamically in the Now platform.
Please try the below code-
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var infoField = g_form.getField("payments_label");
if (newValue == 'vendor') {
infoField.expand_help = true;
infoField.instructions = "<p>Please search invoice in the Report/SearchReport/Search tab in My Payables before submitting ticket.</p>";
} else {
infoField.expand_help = true;
infoField.instructions = "<p></p>"; // Clear the help text by setting an empty paragraph
}
}
Or try this-
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var infoField = g_form.getField("payments_label");
if (newValue == 'vendor') {
infoField.expand_help = true;
infoField.instructions = "<p>Please search invoice in the Report/SearchReport/Search tab in My Payables before submitting ticket.</p>";
infoField.help_tag = "More information";
} else {
infoField.expand_help = true;
infoField.instructions = "<p></p>"; // Clear the help text by setting an empty paragraph
infoField.help_tag = "";
}
}
If the above doesn't work try to take a look into these below posts-
Can you please try to take a look into the below posts-
If my response has resolved your query, please consider giving it a thumbs up and marking it as the correct answer!
Thanks & Regards,
Sanjay Kumar