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 01:55 PM - edited 07-17-2025 01:56 PM
Did you also catch the error with an 's' missing in business_application in the getReference line? Good chance if you didn't its evaluating the if statement as false since ref will be null.
Sorry for the mistakes I was getting a phone call as I was writing that response and was rushed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 11:30 PM
No need to apologize. Thank you for continuing to provide assistance. I did correct the misspelling on the business application, but it still hasn't triggered.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 11:49 AM
We sincerely thank everyone for their help and input. At this point, we’ll proceed with hardcoding the sys_id to ensure the functionality works, as we have a project deadline to meet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 11:33 PM
@Lisa Goldman
Understandable.
TIP: if you want to avoid hard-coding, call a property in your catalog client script (gs.getProperty() is not supported for client side so a GlideAjax call is needed) but then you could update the condition by changing the property's value without touching the code in the future...
No AI was used in the writing of this post. Pure #GlideFather only