How to control Popular Items content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 06:27 AM
I’m seeing in other Community postings that you can control what shows up in the Service Portal "Popular Items" by cloning the SC Popular Items widget and adding script like I’ve done in the below screenshot. This is not getting me the desired results and does appear to be removing any of the catalog items I need removed from Popular Items. If I right-click/Ctrl on Popular Items in the Service Portal and select Instance in Page Editor, the widget it is using is SC Category Page. So, should I actually be cloning the SC Category Page widget and adding my script to that? If so, where? I don’t see anywhere its Server Script that it is doing any count.AddQuery. Thanks.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 06:36 AM
Hi,
Your query should be
count.addQuery('cat_item.category!=sys_id_of_category');
or
count.addEncoddedQuery('cat_item.categoryNOT LIKEIT ONLY');
Thanks!
Sagar Pagar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 06:42 AM
Hello Chrish,
Yes you need to clone the widget "SC category page". Below are the steps
1)
2) On widget, you have to go to the function getPopularItems () on 156 line of the server code to change the query conditions. Please see below screenshots
Hope it helps!!
Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg
Regards
Sulabh Garg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 07:59 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 06:11 AM
Hi Chrish,
Can you please check if your widget is customized by someone? Or It may be you are on san diego version and the code which I put in my screenshot above was from my PDI (Rome).
Hope it helps!!
Regards
Sulabh Garg