Sai Kumar B
Mega Sage
Mega Sage
We can enable search configurations on Record producer(s) variables so that when users enter data into variable, 
they can access related search results such as articles/catalog items.

Record 
producer 
configurations are available in Service Now to enable this functionality. I'll walk you through how to use
this functionality in this article.

  •  In Application navigator, Go to Contextual search > Record producer configuration
    find_real_file.png

 

  • Go to Record producer configuration table and click New
    1.) Record producer - Give the Record producer name
    2.) Search context - Give the context from which you want to populate the related results, In OOB we have few search contexts available for us, We can also create a custom context.
    3.) Search variable - Give the variable on which you wanna enable the search context
    find_real_file.png

 

  • The following Search Action configurations related lists are automatically populated based on the search context
    find_real_file.png

  • Create custom variable after the variable on which you want to enable Related search results.
    find_real_file.png

  • Let us now put our functionality to the test.
    find_real_file.png
  • If you're unable to see the "Order" button do the following
    1.) Go to the Angular templates(sp_ng_template) table and Locate cxs-result-catalog
    2.) Replace the below existing line , Add the order at end of the
    <a class="btn btn-default sc-btn" ng-href="{{result.related_links[0].sp_link+'&referrer=contextual_search'}}" ng-attr-aria-label='{{i18n.format(c.data.i18nMsgs.catalog.order, result.title)}}'>{{orderActionDetails(result).actionLabel}}</a>
    Below is the updated HTML
    <a class="btn btn-default sc-btn" ng-href="{{result.related_links[0].sp_link+'&referrer=contextual_search'}}" ng-attr-aria-label='{{i18n.format(c.data.i18nMsgs.catalog.order, result.title)}}'>{{orderActionDetails(result).actionLabel}}Order</a>

Pointer: Only one variable within a record producer can use contextual search.

Sources: Define contextual search
Context Search on a Catalog Item - Button Text Issue

If you have any corrections or suggestions, please leave them in the comments section.

Regards,
Sai Kumar

Comments
david kim
Tera Contributor

Is there a way to limit to search results from Catalog Items or Knowledge Articles? For example for certain phrases I only see catalog items since the max number is 10 and there are 10 matching catalog items

Version history
Last update:
‎07-18-2022 02:21 AM
Updated by: