Workspace Declarative Action || Get URL in server script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2022 03:09 AM
Hi,
I am trying to access the current URL in my list declarative action.
Tried various methods in my server script to get the URL but none works.
gs.action.getGlideURI() returns "api/now/v1/batch?api=api"
Any idea?
ServiceNow Community Rising Star 2022/2023
- Labels:
-
Now Experience UI Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2022 07:48 AM
Hello Jagjeet,
Server side, if you are not working with a GlideRecord, you can get the instance URL with :
gs.getProperty('glide.servlet.uri');
Then you can add your URI with :
gs.getProperty('glide.servlet.uri') + gs.action.getGlideURI();
If you work with a GlideRecord, you can get the link with (where gr is your GlideRecord) :
gs.getProperty('glide.servlet.uri') + gr.getLink();
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2022 07:44 PM
These does not return the URL in proper format again.
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2022 09:10 PM
I actually ended up having a custom page in UI builder and then worked with page parameters to get my requirement done.
ServiceNow Community Rising Star 2022/2023