Modify the Popular items list in the service portal

karrierr
Tera Contributor

In the Service Portal OOB, when you click on Order Something, it redirects you to the Service Catalog homepage which displays the Popular Items list.

The client wants to control what items are displayed on this list. They still want to show 9 "items" but some of the boxes they want to see are "Hardware" and "Software" which are not really items, but categories. Is this feasible by modifying the Popular Items widget?

Or any suggestions on how to deal with a combination of categories and items as the default view when clicking on Order Something? Maybe we should not use Popular Items at all, rather display the required categories and items as static on the Service Catalog home widget.

Items/Categories that should replace the Popular Items:

1. Access to MS AX (catalog item)

2. Access to MS NAV (catalog item)

3. Change and Project Request (category)

4. New Employee (catalog item)

5. Update Employee (catalog item)

6. Deactivate Employee (catalog item)

7.Onboarding Package (catalog item)

8.Hardware (category)

9.Software (category)

 

22 REPLIES 22

Jayanthi
Tera Contributor

have you find the solution for this? am also looking for the same requirment

I cloned and modified the SC Popular Items widget (Server script) so that I can control what items can be displayed on the Popular Items list. 

However, categories are still not shown on the popular items since it probably requires more custom changes to make it work.  

As of now, it is OK with my users if only catalog items and record producers are displayed. 

HI Karrierr,

To display categories, use the below script in server side of the widget sc popular item.  

	count = new GlideAggregate('sc_category');
		count.addEncodedQuery('title=Computer');
		count.query();
		while (count.next()){
		var item = {};
		item.page = 'sc_category';
		item.sys_id = 'd0f3575b53813300c128ddeeff7b128b';
		item.name = 'Computer';
			items.push(item);
					 }

 

Kindly mark my response correct and helpful if my suggestion resolved your query,


Thanks

Murali

Muralidharan BS
Mega Sage
Mega Sage

Hi Jayanthi and Karrierr,

One of the option I could think of displaying the items is clone the widget called - sc category page. 

In the line, 162, 164, 166 update the name of the items like below, 

createdQuery = 'cat_item.name=order a laptop^ORcat_item.name=order gaming laptop^'; // Add the sys id or name of item here

 

find_real_file.png

If those are not record producer comment the below line, if the list contains record producer tweak the line 197.

find_real_file.png

 

Result:

find_real_file.png

 

Kindly mark my response correct and helpful if my suggestion resolved your query,


Thanks

Murali