gs.action.getGlideURI() or gs.action.getGlideURI().toString() both are returning null

Pvn1
Tera Contributor

Hi All,

 

I am trying to get user URL from Script Action on 'login' event, using below code but it is returning as null. The same code works in background script though. Any pointers on what is missing?

 

var url = gs.action.getGlideURI();

gs.log('URL:'+url);

 

 

5 REPLIES 5

Peter Bodelier
Giga Sage

Hi @Pvn1 

 

You can't do this with a Script Action. It is running async, as system not as the user, and therefore has no access to the URL.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

@Peter Bodelier 
Thanks for your reply. Could you please advise if we can access user's login URL from UI Script everytime the user logs in the instance?

I'm not sure this is something you should do.

Could you explain the use case for this? Maybe there is a better approach?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

@Peter Bodelier 
I want to track user's native UI login time separately, since the OOB field on user table gives the login time of both native and portal.