- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 05:21 AM
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.
Regards,
Manikanta Vankayala.
Solved! Go to Solution.
- Labels:
-
Agent Chat
-
Virtual Agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 05:51 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 05:51 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 07:25 AM
Hi,
something like this
1) you can use Table output as Bot response with this script
(function execute(table) {
var allCriterias = new sn_uc.UserCriteriaLoader.getAllUserCriteria(gs.getUserID());
var arr = [];
var gr = new GlideRecord("sc_cat_item_user_criteria_mtom");
gr.addQuery("user_criteria", "IN", allCriterias);
gr.query();
while (gr.next()) {
arr.push(gr.getValue('sc_cat_item'));
}
var gr = new GlideRecord(table);
gr.addEncodedQuery('sys_id', "IN", arr.toString());
gr.query;
return gr;
})(table)
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 09:37 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2022 10:08 AM
Hi
Thanks for responding.
Yes I'm receiving the input from user and By using OOTB Catalog item Search Topic Block.
Here is the script used in that Search.