Sorting Service Portal Categories by Title
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2018 12:54 PM
Hi ServiceNow Community - Can someone please explain how to sort your categories on your Service Portal by Title? I've created about 30 categories and for whatever reason they are not at all sorted in any order that I can see. They're basically all over the place. On our Service Portal we have three columns and I'm looking to sort them by Title from left to right.
1). I've already tried using the "Order" column which only sorts them in the list and not the portal.
2). I've already tried editing the Server Script (sc.orderBy), but it's already set to "Title" and it actually doesn't allow me to edit it anyway as the Widget is Read Only.
It's hard for me to believe that it's this difficult to sort your categories on your Service Portal. Hopefully I'm missing something here.
I've attached a screenshot of what the categories look like on the portal. As you can see they don't seem to be in any order whatsoever...
Any help would be greatly appreciated...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2018 01:14 PM
I think you will have to edit the widget. The widget is called "Categories" and you will find this code on the server script.
var sc = new GlideRecord('sc_category');
sc.addQuery('sys_class_name', 'sc_category');
sc.addActiveQuery();
sc.orderBy('title');
data.sc_catalog = $sp.getValue('sc_catalog');
if (data.sc_catalog)
sc.addQuery('sc_catalog', data.sc_catalog);
Just change the sc.orderBy line to order how ever you want.
ServiceNow Commnunity MVP -2018 class.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2018 03:09 PM
Hi Karthik - Not sure if you read my post fully, but thank you for responding.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2018 08:15 PM
recently I spent a good amount of time understanding the behavior of the way items appear in the portal and based on the my knowledge.
the screenshot you sent is the screenshot of the items I believe.. not the category.
Items will be sorted based on combination of order and alphabetical, lets say we have 3 items
Car -- 100
Bike - 200
AirBus - 100
items will appear in below order
They are two options to see the catalog items, list and tiles, in tiles mode they appear from left to right based on above logic, and list is based on top to bottom based on above logic.
Airbus
Car
Bike
If you want to control this behavior and have them appear in alphabetical order, set the order of all catalog items to same order, else set the order of the catalog item based on the order you need.
hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 08:35 AM
- Navigate to sc_cat_item.list
- Search for the category the catalog item belongs to
- Set order number to "0" for the item to be displayed first
- Click Name to sort catalog items alphabetically in the same category
- Set order number (any number greater than zero) for each item