- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 04:08 AM
This URL leads to a dashboard on test instance. How to make this URL a dynamic URL for dev and prod instances. I am making use of this URL in a client script.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 04:21 AM
HI,
You can use the below property to build the URL dynamically
gs.getProperty("instance_name")+".service-now.com";
OR
gs.getProperty('glide.servlet.uri')
PS, they both run server side so you may need to pass it using a display BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 04:41 AM
no need to make it dynamic
Simply make it relative like this
/$pa_dashboard.do?sysparm_dashboard=4756****dbc4bc103450****d3961...
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 04:56 AM - edited 05-29-2024 05:15 AM
var HelloWorld = Class.create();
HelloWorld.prototype = Object.extendsObject(AbstractAjaxProcessor, {
helloWorld:function() {
var instanceURL = gs.getProperty('glide.servlet.uri');
return instanceURL;
} ,
type: 'HelloWorld'
});
client script :
var ga = new GlideAjax('HelloWorld');
ga.addParam('sysparm_name', 'helloWorld');
ga.getXML(HelloWorldParse);
function HelloWorldParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer+ '$pa_dashboard.do?sysparm_dashboard=58c3b187***72300117b******';);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 04:21 AM
HI,
You can use the below property to build the URL dynamically
gs.getProperty("instance_name")+".service-now.com";
OR
gs.getProperty('glide.servlet.uri')
PS, they both run server side so you may need to pass it using a display BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 04:41 AM
no need to make it dynamic
Simply make it relative like this
/$pa_dashboard.do?sysparm_dashboard=4756****dbc4bc103450****d3961...
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 04:56 AM - edited 05-29-2024 05:15 AM
var HelloWorld = Class.create();
HelloWorld.prototype = Object.extendsObject(AbstractAjaxProcessor, {
helloWorld:function() {
var instanceURL = gs.getProperty('glide.servlet.uri');
return instanceURL;
} ,
type: 'HelloWorld'
});
client script :
var ga = new GlideAjax('HelloWorld');
ga.addParam('sysparm_name', 'helloWorld');
ga.getXML(HelloWorldParse);
function HelloWorldParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer+ '$pa_dashboard.do?sysparm_dashboard=58c3b187***72300117b******';);
}