How can I get the URL of the instance and use it in the SP widget?

Ro5
Tera Expert

hello.
I want to be able to transition to another page of that instance by getting the "devxxxxx" part of the URL of the instance with the client controller of the SP widget and adding the address after that, but I don't know how.
If anyone knows how to do this, please let me know.
The image of the flow is as follows.
1. Get the "devxxxxx" part of the URL
2. Create URL by adding protocol and page ID etc.
3. Put the created URL in a harf of HTML

 

Regards,
Ro

2 REPLIES 2

Ankita19
Tera Guru
Tera Guru

Hi,

you can create system property to store your instance url and use that property by gs.getProperty in your script .

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Ro5 

var url=gs.getProperty("instance_name")+".service-now.com";

 

check below thread. That might help you 

Instance URL via JavaScript 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy