- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 12:11 AM
Hello,
I have written this client script on catalog variable set.
When I am checking the value for type, it's not returning anything in the background. Please check the snip below
Below are the choices-
Here's another snip of the logs
Also, I have tried to remove the space from the value of options but it didn't help
May I know if this is a expected behaviour?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 12:29 AM
Hi @Saurav Bhardwa2,
Try the below script.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue == 'Modify Existing') {
g_form.showFieldMsg('type', 'Your existing access will be removed and the new access will be added.', 'info');
}
}
Mark this answer as correct and helpful if it solves your issue.
Regards,
Siva Jyothi M.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 12:19 AM
Hi @Saurav Bhardwa2 ,
I would use newValue instead g_form.getVlaue() and try to print what it display , then compare it in if condition.
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 12:29 AM
Hi @Saurav Bhardwa2,
Try the below script.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue == 'Modify Existing') {
g_form.showFieldMsg('type', 'Your existing access will be removed and the new access will be added.', 'info');
}
}
Mark this answer as correct and helpful if it solves your issue.
Regards,
Siva Jyothi M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 05:21 AM
Seems like you are trying to use this script on the portal. Could you confirm if you have set the UI type = ALL for your client script?