Issue with Accessing Variable Value in Variable Set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 08:48 AM
Hello,
I need help retrieving the value from a Variable Set.
Here's what I’ve tried so far, but it’s not triggering the alert. Thank you
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var applicationName = g_form.getDisplayValue('business_application');
if (applicationName === 'Maximo') {
alert(applicationName);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 09:47 AM
Thank you of helping @Chaitanya ILCR
The business_application field is a Lookup Select Box type.
What we're trying to achieve is: after the RITM is created, if the business_application value contains "Maximo" or "Office365", the Service Type field should be hidden, as shown in the screenshot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 09:58 AM
Hi @Lisa Goldman ,
try this
if it's not working please share the business_application variable screenshots
would like to see the type specifications section
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var applicationName = g_form.getDisplayBox('business_application').value;
alert(applicationName);
if (applicationName == 'Maximo') {
alert(applicationName);
//if working add the logic to hide the variables
}
}
you can use the GlideAjax approach to get the name or instead of name you can compare with sysids (Maximo) sysid Office 365 sysid
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 10:12 AM
I have tried your suggestion code and it still not working. Here is the specification section for your review:
How do use GlideAjax approach to get the name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 10:18 AM
Hi @Lisa Goldman ,
try this
you should be able to see alerts this time
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
// return;
}
//Type appropriate comment here, and begin script below
var applicationID = g_form.getValue('business_application');
var applicationName = g_form.getDisplayBox('business_application').value;
alert(applicationName);
alert(applicationID);
if (applicationName == 'Maximo' || applicationID == 'Maximo') {
alert(applicationName);
//add logic to hide
}
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 10:36 AM
I’d like to confirm where the code should be entered. Should it go in the Variable Set Catalog Client Script, as shown in the screenshot below? If so, it's currently not triggering.