Make SC Catalog Item 2 widget for service portal open one specific catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 07:39 AM
Hi all
I have a requirement to make a copy of the SC Catalog Item 2 widget and code it to open one specific catalog item only. This is because we are creating a separate portal that will be set to public, with one landing page which will also be set to public, and on that page will be the copy of the SC Catalog Item 2 widget which will also be set to public. We want that widget to display one particular catalog item form which will be completed by people outside of our organisation.
Currently, the SC Catalog Item 2 widget is passed the sys id of whichever cat item/ record producer the user clicks on via the SC Category page widget (or a group of other widgets I think e.g. popular items etc). If anyone knows what I would need to do to the code of the SC Catalog Item 2 widget to set it to open one specific catalog item every time, without the user first clicking on an item on the SC Category page widget, that would be great!
Thanks in advance
Sarah 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 02:00 PM
Hi Sarah,
this is quite easy, ACL may be a bigger concern to make it available to public.
In your cloned widget, you need to define new option and then adjust the Server script just a little
1. Create a new option (in the widget editor, select Option schema), referring to the catalog item you want to use, e.g. something like this
2. In the server script focus on line 214 and change it from
data.sys_id = $sp.getParameter("sys_id") || $sp.getParameter('sl_sys_id');
to
data.sys_id = options.cat_item || $sp.getParameter("sys_id") || $sp.getParameter('sl_sys_id');
3. Then just place the widget to any page if you haven't done yet, CTRL+right click on it and select 'Instance Options' and select the Catalog item there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 01:07 AM
Hi Jan
Thanks very much for coming back to me.
I've tried your solution but unfortunately, when I access the page the widget says "You are either not authorized or record is not valid."
Here's screenshots of what I did -
Any idea where I could be going wrong?
Thanks very much,
Sarah

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 04:39 AM
Hi Sarah,
I am wondering what version of ServiceNow are you running?
When I create a new page, place there the new widget and set the catalog item in options schema it starts working immediately.
Furthermore in my widget (cloned from widget-sc-cat-item-v2) I don't have the section you show on your screenshot... anything above line 203 of your code is completely different than my PDI widget 😕
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 06:19 AM
We're on Rome.
I just tried cloning the exact same OOB widget as yours (as previously I was cloning a customised version of that widget), and edited the server code on line 214 like you said, but still no luck, sad times