- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2022 11:24 AM
Hi All,
I have requirement pass variables values in URL parameters.
EX: When user is trying to open blocked site it will populate window stating that you don't have access this site, Please create Service Catalog request to get the access. (window will have link to service catalog item).
When user click on Service catalog link, catalog item page will open in servicenow; We have requirement to prepopulate URL and URL category in the catalog form and user wants to manfully submit the request in ServiceNow (Manually click order now button)
Can we add variables values using URL parameters; so that when user click on link in window in blocked site it should open catalog item page and should prepopulate variables.
Thanks,
Priya
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2022 11:48 PM
Portal :
var site = top.location.href;
var input1 = new URLSearchParams(site).get("sysparm_input1");
var input2 = new URLSearchParams(site).get("sysparm_input2");
Native View:
var gUrl = new GlideURL();
gUrl.setFromCurrent();
var input1= decodeURI(gUrl.getParam('sysparm_input1'));
var input2 = decodeURI(gUrl.getParam('sysparm_input2'))
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0783157
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2022 12:34 PM
Hello,
Check out my accepted solution here for a similar request:
https://community.servicenow.com/community?id=community_question&sys_id=fe24fe67dbb8741013b5fb243996190d
This should hopefully answer your question.
Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2022 11:48 PM
Portal :
var site = top.location.href;
var input1 = new URLSearchParams(site).get("sysparm_input1");
var input2 = new URLSearchParams(site).get("sysparm_input2");
Native View:
var gUrl = new GlideURL();
gUrl.setFromCurrent();
var input1= decodeURI(gUrl.getParam('sysparm_input1'));
var input2 = decodeURI(gUrl.getParam('sysparm_input2'))
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0783157