How to restrict the catalog Categories and Catalog Items in Service Portal?

ssswetha13
Tera Contributor

Hi All,

I have a requirement where I need only four Categories   and their few respective Catalog Items to be visible on Service Portal. The categories also include content Items.Below are the two scenarios of the requirement.

1) I have used an Icon Link Widget in homepage which queries the Service Catalog table as per its default functionality. As per the requirement, on clicking upon the Icon link it is redirecting to the "sc_home page", but it is showing all the categories. How can I customize the page/widget after cloning it, so that it shows only the required Categories. Also, I don't want to deactivate the other unwanted categories in service catalog.

2) So, based on the category that has been selected, all the catalog Items and Content Items are also visible. Is there way to restrict the content Items and Catalog Items, so that only the required ones are visible without deactivating the other unwanted Catalog Items?

15 REPLIES 15

ssswetha13
Tera Contributor

Hi Jiten,


Thanks for the reply. However, I have around 15 different categories (including both OOB and Customized). I believe querying each category wont be a best practice. Is there any other way?


If you want to display only certain categories in portal then add a field on categories table called Is portal(True/False) field.



Once you add the field copy the OOB SC Categories widget and update the server script by querying the Is portal field. If you requirement also needs to display only certain catalog items in a category then create a field on catalog item and copy the SC Category Page widget and update the server script accordingly.



Let us know if you need more help



Thanks


Jeet
Tera Expert

You copied my answer bro bingo I was also about to write the same !!


Hi Swetha,



You can create one more field on service catalog side for service portal categories that you want to show on your portal, like "SP Active" just pass Boolean value to the filed and fetch the record adding this condition true in your gr query.



var count = new GlideRecord('sc_cat_item');


count.addQuery('SP Active', true);


count.query();




Thanks,


Jeet


ssswetha13
Tera Contributor

I have just cloned the sc_category widget, and I am getting the following error. Even after doing the needful, I am not able to update the widget.


Please refer the below screenshot:


find_real_file.png