- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 05:53 AM
I have a variable in a catalog item that I would like to use in Service Portal. This variable has a default value that would be passed as a parameter from another task.
Typically in the past, I have used javascript:RP.getParameterValue('sysparm_parent');
My URL would then have &sysparm_parent=${sys_id} appended to it. This doesn't appear to be working in Service Portal. Does anyone know if this is not supported? If not, are there other ways we can pass values into forms in the Service Portal?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 08:41 AM
I think those methods will not work.
you can do with one client script to set the value. In that use the method,
var URL = this.location.href; // it will get the URL of the catalog item. It will work in both service portal and regular view.
from that you can try get the value of sysparm_parent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 08:41 AM
I think those methods will not work.
you can do with one client script to set the value. In that use the method,
var URL = this.location.href; // it will get the URL of the catalog item. It will work in both service portal and regular view.
from that you can try get the value of sysparm_parent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 09:14 AM
Thanks, I was able to get the value I needed using this.location.href on an onLoad script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 10:33 AM
welcome Adam. Happy that your issue was resolved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2020 03:37 AM
Hi,
After retrieving the URL with the parameter, how do you pull the value of the parameter.?
I have a URL that contain 2 parameters
https://INSTANCE.service-now.com/sp?id=sc_cat_item&sys_id=969afe0edbc68c5077b67abe3b9619a2&sysparm_subject=VALUE1&sysparm_description=VALUE2
i need to pull the values of both sysparm_subject and sysparm_description.
Do you know what will be the best way to get it?
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 08:59 AM
As far as I know, RP object will work on CMS but not on service portal. As balaji mentioned, you need to write some client side js for this. See the following link on how to parse url on client side
Parse URL Parameters in a Client Script - ServiceNow Guru