https://docs.servicenow.com/bundle/jakarta-platform-administration/page/administer/contextual-search/task/t_DefineContextualSearchForForm.html



Define contextual search to display search results in a table, such as the form for the Incident table.

Before you begin

Role required: admin

About this task

In Contextual Search > Table Configuration, you can configure the form that is associated with a table to display contextual search results. You specify where the search results appear, the information the results contain, and what the user can do with the results.

When knowledge articles are associated with a record, those search results can be included in email notifications. For example, email notifications sent when an incident is created can include knowledge search results. An article in the search results may help the user who raised the incident resolve the issue independently.

In the table configuration record, specify which fields on the form trigger a search. For example, contextual search in the Incident form can display search results based on text entered in the Short description field.

Procedure

  1. In the Search Context form, open the Table Configurations related list and click New.Alternatively, navigate to Contextual Search > Table Configuration and click New.Define contextual search for a table_第1张图片

  2. Complete the form.Table Configuration fields

    Field Description
    Table Name of the table name associated with the form, for example, Incident [incident].Note: The list shows only tables and database views that are in the same scope as the contextual search.
    Search context Name of the search context this table configuration applies to.
    Results header text Label for the search results area that appears in the form.
    KB attachment How a KB article in search results is embedded in the Comments field on the form.Embed article: The article text is copied into the Comments field in HTML format.Embed link to article: A link to the article is posted in the Comments field.
    Active Check box to activate this configuration.
    Limit Maximum number of search results returned.
    Results per page Number of results to display per page.
    Allow expand/collapse Check box to allow the user to collapse the search results in the form.
    Result action label Label of the action button that appears when the user opens a search result record. By default, this label is set to This Helped.
    Result action value Internal value of the action button that appears when the user opens a search result record. By default, this value is set to This helped. This value is stored in the Relevant Document[cxs_relevant_doc] table.
    Match condition Conditions under which this search is enabled. For example, set [Active] [is] [true] to only enable the search on active knowledge articles.
    Enable search as Defines results to show for a different user. For more information, see Search as different users.



  3. Open the form context menu and select Save.The Search Fields, Filter Configurations, and Email Configurations related lists appear. By default, a search field record is added to search on the Short description field.

  4. (Optional) To use a different search field, open the Short description record, select the field, and click Update.

  5. (Optional) Complete the following steps to add a filter configuration.Filter configurations are defined to map fields from two different tables to provide a more targeted search result set.
    You can also select Scripted filter in the Filter Configuration form and add a script instead of using a filter condition record.

    1. Click New in the Filter Configuration related list.

    2. Select the Search resource: pinned, knowledge, or social.

    3. Open the form context menu and select Save.

    4. In the Filter Conditions related list that appears, click New.Based on the selected Search resource, the filter condition provides a query table to compare with the current form, for example, the Incident form. You select a field from each table, and the search results only include items where the values in the compared fields match.

    5. Select the Field to compare and the Compare to fields for the Query table and Current form tables.

    6. Select what value is compared, the value or the display value.

    7. Select the Include if blank check box to include results if the Compare to field has no value.

    8. Click Submit.

    9. Click Update in the Filter Configuration form.

  6. (Optional) Complete the following steps to define email configurations to include knowledge search results.

    1. Click New in the Email Configurations related list.

    2. Select the email notification to attach search results.You can select only from the notifications that are on the same table as the table configuration record.

    3. Select the field used to restrict the search results.For example, if you select Opened by, the search results include only the articles that the opened-by user can access based on user criteria.

    4. Update the Limit field as desired.

    5. Click Submit.

  7. Click Update to save and close the Table Configuration record.

  8. Add the search results area to the form for the associated table.

    1. Navigate to the relevant form for that table. For example, navigate to Incident > Open and open an Incident form.

    2. Configure the form and add Contextual Search Results in the location where you want to display the results. For example, you can display the search results immediately after the text field the search is based on or at the bottom of the form.

Last Updated: June 15, 2017

Tags: Jakarta, Now Platform Capabilities, Contextual Search