
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 01:03 PM
I'm trying to use the "catalog" example from this post https://community.servicenow.com/community?id=community_blog&sys_id=596dea29dbd0dbc01dcaf3231f96190b - exactly as it is - I need to grab the user sys id from a sysparm_user parameter I'm passing in a URL. The only change to the example code is the variable name. I am getting "undefined" for the user parm and I have no idea why. I added code to grab the sys id of the cat item and it works. Seems like a fairly simple script but I'm having no luck with it. Thanks for any help!
URL - .....com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=e053fdc81b4285100eb20fa2cd4bcbe2&sysparm_user=b0e43ebf1b0081100eb20fa2cd4bcb0f
Works - var id = getParameterValue('sysparm_id');
alert("sysparm_id is " + id); //returns sys id of cat item
Does not work - var user = getParameterValue('sysparm_user');
alert("sysparm_user is " + user); //returns "undefined"
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2022 09:22 AM
Solution!
I needed to use "%26" between parms instead of just the "&"
RIGHT - servicecatalog_cat_item_view.do?sysparm_id=e053fdc81b4285100eb20fa2cd4bcbe2%26
sysparm_user=b0e43ebf1b0081100eb20fa2cd4bcb0f
WRONG - servicecatalog_cat_item_view.do?sysparm_id=e053fdc81b4285100eb20fa2cd4bcbe2&sysparm_user=b0e43ebf1b0081100eb20fa2cd4bcb0f
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 01:22 PM
Use a different var then user. user might be a reserved word in ServiceNow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 01:34 PM
Good thought, but same result...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 01:34 PM
Good thought, but same result...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2022 09:22 AM
Solution!
I needed to use "%26" between parms instead of just the "&"
RIGHT - servicecatalog_cat_item_view.do?sysparm_id=e053fdc81b4285100eb20fa2cd4bcbe2%26
sysparm_user=b0e43ebf1b0081100eb20fa2cd4bcb0f
WRONG - servicecatalog_cat_item_view.do?sysparm_id=e053fdc81b4285100eb20fa2cd4bcbe2&sysparm_user=b0e43ebf1b0081100eb20fa2cd4bcb0f