Virtual agent : Some catalog items and record producers are not showing in the search result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2019 06:10 PM
Hi Everyone,
I'm currently working on a Virtual Agent(Search Topic) in which I have used the Script from ITSM virtual agent plugin-
var context = '6f7e3f565b30130070e4492c11f91aea';
var contextualSearch = new sn_itsm_va.VAContextualSearchUtil();
var response = contextualSearch.search(context, 'Severance');
var success = contextualSearch.processSearchResponse(response);
var relevantSearchResults = contextualSearch.processGeneralResults(response, 20,0);
var kbResultCount = relevantSearchResults.length;
var search_kb_json_string = JSON.stringify(relevantSearchResults);
gs.info("SEARH RESULT: " + search_kb_json_string );
I have tried searching with a keyword Severance I have expected to have these 3 items in the results but I only got one ,which is the Separation with Severance catalog item only:
[{
"snippet": "Separation with <B>Severance</B>",
"image": {
"thumbnail": {
"link": ""
},
"link": ""
},
"related_links": [{
"sp_link": "?id=sc_cat_item&sys_id=6ee57a0513dc360099f85566",
"link": "com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=6ee57a0513dc360099f85566",
"title": "Order"
}],
"meta": {
"score": 549.3299,
"description": "",
"interleaved": true,
"source": "catalog"
},
"link": "cxs_cat_item.do?sysparm_id=6ee57a0513dc360099f85566",
"id": "sc_cat_item:6ee57a0513dc360099f85566",
"title": "Separation with Severance"
}]
- Labels:
-
Search
-
Service Portal
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2019 12:45 PM
Hi there,
Today I ran into the same issue. Already saw (in Madrid version) that in the 'Order an Item' topic, on the Script Action 'Contextual Search', the script mentions on line 14/15:
//Filter out any catalog items that should not be shown ie. Record Producers
//create a filterMap to quickly see if item can be shown to user
This implies that Record Producers are being filtered out. Looking at the script, on line 16 a variable called "vaVars.filter_tables" is mentioned.
Looking at that variable, a Script Variable within the topic actually, it contains "sc_cat_item_content,sc_cat_item_producer,sc_cat_item_wizard,std_change_record_producer,sc_cat_item_producer_service".
So the answer being, literally sc_cat_item_producer is being filtered out! Also tested this, removed the sc_cat_item_producer, published the topic, refreshed the Virtual Agent... works!
Also, If you have a lot of matched Catalog Items, only 5 will be shown. Reason being, the topic has a Script Variable called "limit". The value for this Script Variable obviously being 5.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2019 11:24 AM
Hi there,
Please mark this answer as correct if it solves your problem. This will help others who are looking for a similar solution.
Thanks.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2019 08:36 AM
Thanks Mark, your update resolved my one of the issue.Changed the limit value and working expected.
But another issue found is, in the 'Order an Item' topic the search result is showing some non-related items also.
Can you please tell how does Contextual search works? which field is being checked?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2019 02:57 PM
Hi there,
If my answer helped you in any way, please then mark it as helpful.
Please mark this answer as correct if it solves your problem. This will help others who are looking for a similar solution.
Thanks.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field