- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 06:51 AM
Hi,
We have a ui action in List context menu, and need to access the current URL for a requirement. Is there any OOB script to fetch the current URL in UI action. Please help.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 07:11 AM
Hi there,
This code should work for any server-side script (including UI Actions) to get the current URL:
gs.getProperty("glide.servlet.uri") + gs.action.getGlideURI();
If this answer is helpful please mark correct and helpful!
Regards,
Christopher Perry
Regards,
Chris Perry

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 07:11 AM
Hi there,
This code should work for any server-side script (including UI Actions) to get the current URL:
gs.getProperty("glide.servlet.uri") + gs.action.getGlideURI();
If this answer is helpful please mark correct and helpful!
Regards,
Christopher Perry
Regards,
Chris Perry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 08:05 AM
Thank you, its working...
Also is there any way to get a particular sysparm variable from current Url that we fetched?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 08:09 AM
Could you please share the URL and which sysparm variable you are trying to fetch?
Regards,
Christopher Perry
Regards,
Chris Perry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 08:30 AM
"alm_hardware_list.do?sysparm_query=u_hardware_type%3DMonitor%5Einstall_status%3D6%5Esubstatus%3Davailable&sysparm_rit=1251182f1b124990f576dd31b24bcbfc&sysparm_first_row=1&sysparm_view="
This is a sample URL and we need to fetch sysparm_ritm , is a sys_id.