Display Only Favourite Knowledge Article for the logged in user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12 hours ago
I have a custom portal to handle a single knowledge base and it's Article only. We have used the OOB my favourite widget to access the users favourite articles but the fact is that the widget is showing all the fev. articles along Favourite catalog etc, but I only need to display only article ont any other data. (There are filter options to filter the source, I don't wanna show the filter also. I need to see the list of all of my favourite articles)
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11 hours ago
Hi @ANINDYA SUNDAR ,
You need to go with the custom solution as I said in one of your post...
Clone the My Favorites or Favorites List widget....Modify the widget’s Server Script to filter by table....In the server script of the cloned widget, add or change the query on the sp_favorite or sys_ui_bookmark table (or whichever table holds favourite records) to only return those favorites where the URL or associated record is a knowledge article....
For example add something like:
gr.addQuery('url', 'CONTAINS', '/kb_article'); // or whatever URL pattern matches KB articles
// OR
gr.addQuery('table', 'kb_knowledge'); // if the favorite record stores the table name
In the cloned widget’s HTML / Angular template, remove or hide any filters (e.g. dropdowns or buttons) that let the user filter sources or show catalog vs article favorites. This makes the display always only knowledge article without filter options.....
You could also adjust the client script part of the widget so that it removes any non knowledge article favorite items from the list before rendering. For example, in client script loop through data.favorites and only keep ones where item.table=='kb_knowledge' (or item.url matches kb pattern)....
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/