How do I create a 'Recent Items' widget based on the 'Recent & Popular Items' widget

matthew_hughes
Kilo Sage

I'm wanting to create a separate widget for 'Popular Items' that currently include viewed knowledge articles and catalogue items. 

 

I understand that there is already an OOTB widget called 'Recent & Popular Items':

matthew_hughes_0-1727178277961.png

However, the only problem with the 'My Recent Items' tab is that it only shows catalogue items as opposed to showing catalogue items and knowledge articles.

 

Does anyone know what I would need to do get a brand new 'Recent Items' based on the current functionality, but including knowledge articles?

 

 

3 REPLIES 3

Isaac Vicentini
Mega Sage
Mega Sage

Hi @matthew_hughes!

 

You can clone this widget and perform a get on the kb_use table using GlideRecord and applying the query: viewed = true.

 

With the data obtained from the table, you can build the same logic as exists for the data.popularItems[] and data.recentItems[] arrays of this widget.


If my answer helped you in any way, please mark it as correct/helpful 🙂

Regards,

Isaac Vicentini.

 




Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.

So there's no way of taking out the section that currently exists and reapplying it?

Yes, it is possible, but you must do this on the cloned widget and not on the original widget.

All you have to do is analyze which block of code you want to remove or change.

 

Below is an example in red of the code block for the My Recent Items tab and in green the code block for the Popular Items tab:

 

IsaacVicentini_0-1727185816868.png


If my answer helped you in any way, please mark it as correct/helpful 🎯

Regards,

Isaac Vicentini.

 




Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.