- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 09:39 AM
I have a Catalog Client Script that acts on the form only when the item is being filled out in a specific Order Guide. However, we are trying to get everything to work in the Service Portal in Helsinki, but it seems that the $("sysparm_guide") in the Client Script no longer pulls the sys_id of the guide being used.
I can try to work around it by having a hidden variable that populates from the cascading variable, which in turn will perform the same actions, but I wanted to see if anybody knows how the Guide being used can be identified from the Service Portal.
function onLoad() {
var guide = $("sysparm_guide");
if (guide.value == 'bf2b9d31130de6002d763d27d144b082') { //Standard New Hire Order Guide
g_form.setValue('service','new');
g_form.setDisplay('service',false);
}
}
I can tell that the URL is different for the Service Portal, and it does only show the sys_id of the guide being used. How would I pull the sys_id from the URL efficiently?
https://instance.service-now.com/sp?id=sc_cat_item_guide&sys_id=002a1ead135d2200a9aeff82e144b088
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 11:13 AM
Hi Simon,
Service Portal doesn't support any DOM techniques like jquery or prototype as explained in the article I linked to below. However, if you scroll all the way down to the bottom it addresses how to determine whether you're in an order guide or not.
documentation/client_scripting.md at master · service-portal/documentation · GitHub

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 01:23 PM
Hmm...in that case you may need to try to parse it out from the url.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 02:47 AM
Hi Brad,
When i am trying to access the article which you have mentioned in solution it is showing me some error. Could you please text the article name again

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 08:11 AM
I think that documentation was taken down, but you can find something similar here:
Service Portal and client scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2019 05:49 AM
Hi Brad,
I have the same issue but I am unable to open the link which you have provided. Could you please help me out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 02:45 AM
Hi Brad,
When i am trying to access the article which you have mentioned in solution it is showing me some error. Could you please text the article name again