- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 12:42 PM
Is it possible to hide a popular item from popping up here? So if I don't want apple ipad 3 to not show up in the popular item is it possible?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 02:55 PM
Best Practice would be to create a system property and store comma separated sys_id values of the to be hidden catalog items in this property.
Then you can add below one line of the code in Server Script of cloned widget. That is it. You are set.
Next time when you are asked to again exclude/include another catalog item , You just need to add sys_id of the catalog items in the property. No code change required.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2020 05:40 AM
Ah your code is slightly different, though similar luckely.
Change:
if (!allowedItems.includes(catItemIds[i]))
Into:
if (!allowedItems.includes(catItemIds[i]) && catItemIds[i] != 'the_apple_ipad3_sysid')
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
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
04-10-2020 06:37 AM
If I have multiple sys id would I just add commas for each one?
if (!allowedItems.includes(catItemIds[i]) && catItemIds[i] != 'c49e04981b5bc0508c8b42eddc4bcb85, sys id, sys id?')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2020 08:26 AM
So what do these multiple catalog items have in common? Are they for example all from a certain category? And do you actually want that category not to be shown in the popular items?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
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
04-10-2020 06:54 AM
I try comma, semi colon and that didn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2020 07:11 AM
John, Did you replace existing widget with cloned widget in the page ?