gs.action.getGlideURI() or gs.action.getGlideURI().toString() both are returning null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 04:36 AM
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);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 05:23 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2023 09:02 PM
@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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 05:02 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 05:58 AM
@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.