How to show only Catalog items that are available for logged in users in Virtual agent. catalog item search

manikanta1258
Tera Contributor

I've created a topic Create a ticket or request in Virtual agent. I've used catalog item search topic block to get the catalog item we have searched with user input text. But it is showing all the item available in the catalog. 

I would like to see only the catalog items should be shown for which the user has access.

@Ankur Bawiskar 

Regards,

Manikanta Vankayala.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you are asking user to input catalog item name?

If you want to show catalog items which user has access then you can use User Criteria API and use script and check which catalog items are satisfied and return those

UserCriteriaLoader - API to Evaluate User Criteria

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Shreya Bakre
Tera Contributor

Hi Manikanta,

Is your requirement to control access to catalog items based on different sets of users or to restrict based on catalogs? Both are achievable:

  1. TO CONTROL ACCESS FOR USER GROUPS:
  • The ideal way to do this would be create User Criteria that define different user sets based on roles/departments/locations or user names. You may need to create multiple User Criteria based on how many user sets you have.
  • Then associate these User Criteria in the "available for" Related List of each Catalog Item in your environment.
  • This will restrict users to view only those items that they have permission to view. Do note that this is an across platform change and will apply to Service Portal searching too - which should be okay if the requirement is to control access at user level.

 

     2. TO RESTRICT SEARCH OF VIRTUAL AGENT TO SPECIFIC CATALOG(S):

  • If your requirement is to restrict VA to search and display items only from a certain catalog, navigate to 'Search Contexts' --> Open your context record the sys_id of which you must have specified in your topic --> Go to 'Resource Configurations' related list --> Open the 'catalog' record --> Under 'Search Resource Context Properties' there must be a 'Catalog Name' property --> Open this property and add names of catalogs that you wish to restrict your search to.

 

You may use one or both of the above to meet your requirement. I hope this helps!