- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2019 07:53 AM
Hey SNC!
We have re-arranged some of our catalog items on the service portal and because of this, we want to reset CERTAIN CAT ITEMS from appearing in the popular items widget on the service portal. To clarify, I don't want to reset the entire popular items listing (not sure if that's even possible), I'm hoping to reset the 'counter' (or however it's done), for specific catalog items only.
I have been unable to find any information regarding this nor have I seen any community posts similar.
Anyone know if it's possible to reset this and provide steps on doing so?
Thanks in advance!
Solved! Go to Solution.
- Labels:
-
Request Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 12:24 PM
Hi there,
The Service Portal Widget for Recent & Popular Items is looking at the sp_log table.
var recent = new GlideAggregate('sp_log');
recent.addAggregate('COUNT', 'id');
if (recent_by === 'view')
recent.addEncodedQuery('userDYNAMIC90d1921e5f510100a9ad2572f2b477fe^type=Cat Item View^sys_created_onONThis quarter@javascript:gs.beginningOfThisQuarter()@javascript:gs.endOfThisQuarter()');
else
recent.addEncodedQuery('userDYNAMIC90d1921e5f510100a9ad2572f2b477fe^type=Cat Item Request^sys_created_onONThis quarter@javascript:gs.beginningOfThisQuarter()@javascript:gs.endOfThisQuarter()');
recent.groupBy('id');
So If you would like to achieve what you are describing, you have to change the widget queries or clean the sp_log table a bit.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 12:24 PM
Hi there,
The Service Portal Widget for Recent & Popular Items is looking at the sp_log table.
var recent = new GlideAggregate('sp_log');
recent.addAggregate('COUNT', 'id');
if (recent_by === 'view')
recent.addEncodedQuery('userDYNAMIC90d1921e5f510100a9ad2572f2b477fe^type=Cat Item View^sys_created_onONThis quarter@javascript:gs.beginningOfThisQuarter()@javascript:gs.endOfThisQuarter()');
else
recent.addEncodedQuery('userDYNAMIC90d1921e5f510100a9ad2572f2b477fe^type=Cat Item Request^sys_created_onONThis quarter@javascript:gs.beginningOfThisQuarter()@javascript:gs.endOfThisQuarter()');
recent.groupBy('id');
So If you would like to achieve what you are describing, you have to change the widget queries or clean the sp_log table a bit.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 12:33 PM
Thanks Marc for pinpointing where this is being calculated. Wish there was a more OOtB solution, but good to know it can be accomplished with a custom widget.