- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 03:14 PM
Hi,
How can I grab the URL of the current page through a UI action?
I have created a UI action that can be a button on a form and also accessible through the list view as a List choice so multiple records can have this applied at the same time.
I was using current.getLink(), but it doesn't provide the needed behavior when executed from a list view. If using it on multiple records from a list view, I'd like the action.setRedirectURL to go back to the list view rather than pulling up the last record that was updated.
I have tried using parent.window.location.href, but no luck.
Thanks,
Adam
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2022 04:49 AM
I just searched scripts for other UI actions and found that this works: GlideSession.get().getStack().bottom();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 03:27 PM
You can follow below article:
How to get the URL in Server Side
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2022 04:38 AM
I tried the link, but unfortunately I am getting back undefined for both
gs.action.getGlideURI()
and
gs.getSession().getUrlOnStack()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2022 04:43 AM
Hi Adam,
Can you refer - https://community.servicenow.com/community?id=community_question&sys_id=e61dec0adb600c10190dfb2439961959
Regards,
Deepankar Mathur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2022 04:49 AM
I just searched scripts for other UI actions and found that this works: GlideSession.get().getStack().bottom();