- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2018 06:03 AM
We are using Jakarta.
I need the articles I create for a KB to display on the service portal with the newest articles displaying first.
Currently they seem to display alphabetically (a to z).
This is just for the service portal side of things.
Here's what we get now...
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 10:11 PM
Good that you found the solution!
Yeah, it's just adding a dash before to make it descending when setting order in angular.
The problems with differing time zones, you see the community updates at the wrong time.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2018 09:37 AM
They're mostly wrong. You can definitely do this in your current setup by following the instructions I provided (which I've successfully tested in my personal dev instance). They're also incorrect in saying you need to activate that plugin.
Where there is some truth to that statement is that the plugin they mention will allow users to sort KB results by a variety of factors (and much more powerfully). That also requires a re-work of your Service Portal to implement the new Knowledge management portal and its associated widgets. That may be a good option, but it's definitely not a requirement.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2018 10:16 AM
If you do want to use the new, enhanced Knowledge portal, there are some instructions for hooking it into the standard SN portal here...
https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/product/knowledge-management/concept/conf-service-portal-know-management.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2018 10:51 PM
Hi,
I was thinking the Knowledge widgets would have that option by now. Realized we hadn't implemented the new Knowledge portal.
So yes, both answers are correct (just not the "Not possible" part from Hi).
As Mark showed in the code example, it's very easy to add an Order by -option in a cloned widget.
If you're not used to use the Portal builder; when you have a widget with an order by option, that option is per page the widget is implemented on.
Either remove the existing widget from the page and add the new one, or create a new page with the Breadcrumb-widget & Typeahead search -widget, Category-widget and your article list widget.
Then press the pen for the article list widget and add your desired field in Order by. This sets the order choice for that page (that instance of the widget).
All Widget instances can be found in the table sp_instance if there is a need to adjust something manually for a page where it's not an option (and there is no need to create an option). We've done that for a link widget on a page that needed a bit of fluff CSS.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 12:47 PM
I've got things working but need to change the direction. They are displaying oldest publish date to newest. I need that reversed.
Here is that line of code:
<div role="listitem" ng-repeat="kb_article in data.items | orderBy: 'published'" class="sp-kb-topic-article m-b-lg">
Can you tell me how to change the order?
Thanks for your help....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 12:52 PM
Hi,
Try below
<div role="listitem" ng-repeat="kb_article in data.items | orderBy: 'published':reverse" class="sp-kb-topic-article m-b-lg">
Please mark Correct/Helpful if it helps.