Modify the Popular items list in the service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2018 02:13 AM
In the Service Portal OOB, when you click on Order Something, it redirects you to the Service Catalog homepage which displays the Popular Items list.
The client wants to control what items are displayed on this list. They still want to show 9 "items" but some of the boxes they want to see are "Hardware" and "Software" which are not really items, but categories. Is this feasible by modifying the Popular Items widget?
Or any suggestions on how to deal with a combination of categories and items as the default view when clicking on Order Something? Maybe we should not use Popular Items at all, rather display the required categories and items as static on the Service Catalog home widget.
Items/Categories that should replace the Popular Items:
1. Access to MS AX (catalog item)
2. Access to MS NAV (catalog item)
3. Change and Project Request (category)
4. New Employee (catalog item)
5. Update Employee (catalog item)
6. Deactivate Employee (catalog item)
7.Onboarding Package (catalog item)
8.Hardware (category)
9.Software (category)
- 4,279 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2020 06:16 AM
Honestly I'm not sure where to add this to in the Server script. Just at the bottom or does it need to be somewhere specific?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2020 06:22 AM
I figured it out, however this is only showing the actual category. Is there any way to make this show the items in the category instead?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2020 06:30 AM
Remove that above script and try this pls, in the line 3, add the sys id of the category.
var count = new GlideAggregate('sc_cat_item');
count.addAggregate('COUNT','name');
count.addEncodedQuery('category=109f0438c6112276003ae8ac13e7009d'); // use the sys id of category
count.groupBy('sys_id');
count.orderByAggregate('COUNT', 'name');
count.query();
while (count.next()){
var catalogItemJS = new sn_sc.CatItem(count.getValue("sys_id"));
var item = {};
var catItemDetails = catalogItemJS.getItemSummary();
item.name = catItemDetails.name;
item.short_description = catItemDetails.short_description;
item.picture = catItemDetails.picture;
item.price = catItemDetails.price;
item.sys_id = catItemDetails.sys_id;
item.hasPrice = item.price != 0;
item.page = 'sc_cat_item';
items.push(item);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2020 11:50 PM
Hi Murali,
Thank you so much for your help. It worked like charm.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 02:47 AM
You've welcome!