Getting URL Parameters in Scoped Application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2019 12:42 AM
I am trying to get URL parameter through catalog client script in Scoped Application. But since Scoped application don't have access to the window object, I am not able to autofill the variables
I found an article
which suggest to use GlideURL class, but I am recieving an error in console
ReferenceError: GlideURL is not defined
Can anyone please help me with how to get URL parameters in Scoped Application.
Thanks in Advance
- Labels:
-
Service Catalog
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2019 10:47 PM
You should be able to use this in the client side;
GlideURI.get('param');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2019 10:56 PM
Hi Harshavardhan,
Try GlideURI in scoped app. If that doesn't work have your catalog client script in global scope and it should work.
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 05:21 AM
In NY release, in a scoped app, I ended up using "top.location".
function onLoad() {
var url = top.location.href;
var param = new URLSearchParams(url).get("my_param");
console.log(param);
}
I'm definitely not happy with this because the use of "top" is a hack and could stop working anytime. GlideURI or GlideURL would be the way to go if only we could use them in a scoped catalg client script on Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 05:28 AM
Hi,
Does this work in Service Portal onLoad as well?
Did you try that?
Regards
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader