- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 12:46 PM
Looking for a way to get the current ServiceNow instance from the Server Side or Client Side in a Service Portal widget. We are building a mailto link and I want to grab the instance name and url for use with the mail to. Only way I can think of now is to query the sys_properties table. Example:
// Get the Instance Name
var gr = new GlideRecord('sys_properties');
gr.addQuery('name','instance_name');
gr.query();
if (gr.next()){
data.instance = gr.value.getDisplayValue();
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 01:18 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 01:18 PM
Did you try
gs.getProperty('instance_name');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2017 05:16 PM
I swear I tried that before and it wasn't working. Thanks.