
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 07:39 AM - edited 01-09-2024 09:45 AM
I am looking to pass additional URL parameters through the service catalog from page to page.
As an example.
https://<instance>.service-now.com/sp?id=sc_category&sys_id=c3d3e02b0a0a0b12005063c7b2fa4f93&myparameters=stuff
The issue arises when you make the next selection in the catalog. The tiles within the catalog are not built to also include any additional parameters. When you click on a tile (sc_catagory page -> sc-category widget), $scope.onClick
executes a function that gathers the tile link data and then calls the following:
$scope.$emit($scope.options.click_event_name, evt);
evt contains the item that was clicked and the link parts but it does not append or include any additional parameters that may have been added to the URL so once the next page loads the parameters are lost.
I'm not sure where to go from here. In this case the event that is passed ($scope.options.click_event_name) is $sp.cat_item_list.click. Where is this defined? Can I change it?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 07:45 AM - edited 01-22-2024 07:46 AM
In the client script for both the sc-categories and sc_category widgets there is a section that builds a list of parameters. Here you can add any additional parameters that you want to pass along.
var s = {
'id': c.data.page || 'sc_category',
'sys_id': category.sys_id,
'catalog_id': c.data.catalog_id,
'spa': 1,
'new_param': c.data.new_param
};
Don't forget to also read the existing parameter into the data object in the server script.
data.new_param = $sp.getParameter('new_param');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 09:35 AM - edited 01-09-2024 09:36 AM
Are you trying to use the cart features of the /sp catalog? when we did this (going back to Jakarta-era, though) we had to do some customizations to disable the catalog -- all of our catalog items are "request now" or "submit" etc, no "add to cart" stuff...I assume this is/was due to the problems you're describing/having where the onClick of the "next" button isn't looking for your parameters in the URL.
Honestly, I don't have any useful advice - just confirming that this is a "normal problem" oob and that our company's solution (which I wasn't involved with at the time, fyi) was to completely disable the "normal cart" features, so that we could force the specific parameters per item being requested, as desired. Essentially, for us it was more effective to force the cart behaviour and retain our URL parameters, than to invest in attempting to change the onClick (if that's even possible).
Since our implementation of the sp catalog, a lot has changed (Jakarta -> Vancouver) and at the time, there was no way to use the cart for SOME items and not for others....it was kinda "all or none"...and we haven't yet attempted to remove our customization (though I'm pushing for that).
I wasn't involved in the decision to not attempt to change the onClick, so I can't say it "isn't possible"...but the partner who did work with us on the implementation at the time wasn't interested in contracting that work and I would assume that was because it wasn't worth our investment (this was a reputable partner, not just looking for cash/business at our expense).
...so my anecdote may not be useful as it is a bit "outdated"...but this is not a new struggle and potentially may not be worth worrying about. However, you may be successful if you only need this functionality on a single/specific item and that you can possibly not add it to the cart (use oob functionality to "request now" on that item)?
Good luck! HTH

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 11:09 AM
We do not use the cart features at all at this point.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 11:34 AM
Oh sorry, I misread. You're passing parameters when going to the root SC page, which don't get included (passed along) after clicking on a tile for a specific item.
I'm afraid I don't have any other advice besides providing a direct link to an item and pass the parameters directly to the catalog item's page....but I can understand that is something you already know and don't need my $0.02 for

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 07:45 AM - edited 01-22-2024 07:46 AM
In the client script for both the sc-categories and sc_category widgets there is a section that builds a list of parameters. Here you can add any additional parameters that you want to pass along.
var s = {
'id': c.data.page || 'sc_category',
'sys_id': category.sys_id,
'catalog_id': c.data.catalog_id,
'spa': 1,
'new_param': c.data.new_param
};
Don't forget to also read the existing parameter into the data object in the server script.
data.new_param = $sp.getParameter('new_param');