- 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 06:32 AM
Is it append from the catalog item URL?
also did you know that URL's of portal and regular view are different. On portal catalog item url is it contains the sysparm_parent value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 06:48 AM
Portal URL with Parameter = https://mycompany.service-now.com/mme?id=sc_cat_item&sys_id=d3fe38c513c4fe00cb92b7a66144b07f&sysparm_parent=f0a783cb1357e200cb92b7a66144b0f5 --> Doesn't work
Normal URL with Parameter = https://mycompany.service-now.com/com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=d3fe38...sysparm_parent=f0a783cb1357e200cb92b7a66144b0f5 -->Works
The default value for my variable is javascript:RP.getParameterValue('sysparm_parent')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 06:53 AM
So based on that, you can get the parameter "sysparm_parent" in both the portal and regular view, is it correct?
sysparm_parent=f0a783cb1357e200cb92b7a66144b0f5 --> this parameter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 07:09 AM
Yes, my URL is correct. What I'm trying to figure out is if I can use the RP object to retrieve the parameter value of 'sysparm_parent' from the URL. In Service Portal my variable is not populated by default using the url, but in regular service catalog it is.
Thanks