Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how can we retrieve the current browser link in a script include?

reeba
Giga Contributor

Hello,

Can someone please tell me how can we retrieve the current complete browser link in a script include?

I have used gs.action.getGlideURI()  : This gives me only "navpage.do" as result

I have also tried using gs.getProperty('glide.servlet.uri') : This gives me only "https://instancename.service-now.com"

Both of them don't retrieve the complete link.

Regards,

Reeba

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@reeba Can't you use a combination of both for e.g.

 

var someURL =.gs.getProperty('glide.servlet.uri')+'/' + gs.action.getGlideURI();
gs.info(someURL);

 

Hi Sandeep,

I tried your suggestion, for this i got the result as "https://instancename.service-now.com/navpage.do" when i opened a ui action, it give the complete link.

Do you have any other suggestions that i should try?

Regards,

Reeba

@reeba What do you mean by the complete link? Could you post a sample link here?