Tie-breaker sort order for Knowledge Articles when sorted by "Views"

zhienqian
Tera Contributor

Hi everyone.

 

I have a question regarding the sort order of Knowledge Articles.

 

In our Knowledge Base, when a user selects "Views" as the sort criteria, articles are displayed in order of view count. However, I would like to know the logic when multiple articles have the same number of views.

1 ACCEPTED SOLUTION

Maham Tahir
Mega Guru

Hi @zhienqian,

 

When sorting by Views in the ServiceNow Knowledge Base (specifically the Service Portal or Knowledge Homepage), if multiple articles have the same view count, there is no default secondary sort logic defined out-of-the-box. The system does not automatically apply a "tie-breaker" like Published Date or Alphabetical order; instead, the order of tied articles is determined by the internal database or search index retrieval order (often effectively arbitrary or based on sys_id). 

 

To enforce a specific secondary order (e.g., sorting by Last Modified for tied view counts), you would need to clone and customize the underlying Knowledge List widget or Search widget to include a secondary sort field in the query.

 

Plus, check this video as well to apply different kind of sortings:

https://www.youtube.com/watch?v=e7mE7ytYey0

 

If you find my response helpful, mark it as helpful and accepted solution.

 

Regards, 

Maham Tahir.

View solution in original post

Struggling to find what you need in messy ServiceNow lists? Fear not! This video will show you exactly how to sort your lists in ascending or descending order, no matter what data you're working with. We'll cover clicking column headers, using the column context menu, and the powerful filter icon
1 REPLY 1

Maham Tahir
Mega Guru

Hi @zhienqian,

 

When sorting by Views in the ServiceNow Knowledge Base (specifically the Service Portal or Knowledge Homepage), if multiple articles have the same view count, there is no default secondary sort logic defined out-of-the-box. The system does not automatically apply a "tie-breaker" like Published Date or Alphabetical order; instead, the order of tied articles is determined by the internal database or search index retrieval order (often effectively arbitrary or based on sys_id). 

 

To enforce a specific secondary order (e.g., sorting by Last Modified for tied view counts), you would need to clone and customize the underlying Knowledge List widget or Search widget to include a secondary sort field in the query.

 

Plus, check this video as well to apply different kind of sortings:

https://www.youtube.com/watch?v=e7mE7ytYey0

 

If you find my response helpful, mark it as helpful and accepted solution.

 

Regards, 

Maham Tahir.

Struggling to find what you need in messy ServiceNow lists? Fear not! This video will show you exactly how to sort your lists in ascending or descending order, no matter what data you're working with. We'll cover clicking column headers, using the column context menu, and the powerful filter icon