Can I rearrange the Category list on the Service Portal

Loretta Bingham
Tera Contributor

I have a client who want to re-arrange the Category list in the Service Portal. For example, "Can We Help You" is in alphabetical order. Client wants to move it to the top of the list for their user. Can this be done with the OOB ? How can this done?

For example, in the screenshot "Can We Help You" is below the "Business Application..." Is there away to move Can We help You above making it first in the list?

 

find_real_file.png

1 ACCEPTED SOLUTION

Loretta,

it looks perfect.


***Mark Correct or Helpful if it helps.***

View solution in original post

9 REPLIES 9

Yousaf
Giga Sage

Hi,

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. 

 

Reference : How to sort the list of categories in service portal(currently as per alphabetical order) as per our...

 

Mark Correct or Helpful if it helps.


***Mark Correct or Helpful if it helps.***

Yousaf,

This is the script for my OOB "Categorgies " (not my client). Please let me know this looks correct in the Server script ?starting at line 133 -145

Function queryCategory(catalogs, nestedLayout, dynamicCategory, startWindow, endWindow) {
            var categoriesGr = new GlideRecord('sc_category');
            categoriesGr.addQuery("sc_catalog", catalogs);
            if (!dynamicCategory)
                categoriesGr.addQuery("sys_class_name", "sc_category");
            categoriesGr.addActiveQuery();
            categoriesGr.orderBy('order');
            categoriesGr.orderBy('title');
            if (nestedLayout)
                categoriesGr.addNullQuery("parent");
            categoriesGr.chooseWindow(startWindow, endWindow);
            categoriesGr.query();
            return categoriesGr;

Loretta,

it looks perfect.


***Mark Correct or Helpful if it helps.***

Btw did my above answer worked?  If it does can you please mark it correct also.


***Mark Correct or Helpful if it helps.***