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

Yes, You just need to update the below GlideRecord query from 

	categories1.addQuery('sys_id','109f0438c6112276003ae8ac13e7009d');

 

to 

categories1.addEncodedQuery('sys_idIN{sys_id1},{sys_id2}');

 

It will work

Because there was so much back and forth in this conversation I think I've confused what is needed and what isn't from the conversation above. I'm being asked to have "Popular Items" just show a category called "Popular Items". Do you mind helping me sort through the conversation above and determine what is relevant?

This is fairly simple assuming that on your homepage there is Icon widget which takes you to popular items page.

 

You need to replace the URL with below link. Just replace category id with your category id.

Please mark my answer correct, If it helped you

find_real_file.png

It's not an individual link to popular items, it's a link to sc_category. I wish it were that simple.

Hi Smfoister,

You can include the below code in the server side,

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);
					 }

 

It will display the category like this below - computer

 

find_real_file.png

To add a description and image you can just include,

item.short_description = "Category";
				item.picture = categories1.picture;

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


Thanks

Murali