--- title: Configure the Case Deflection panel slug: '2111' canonical_url: https://docs.coveo.com/en/2111/ collection: coveo-for-servicenow source_format: adoc --- # Configure the Case Deflection panel A Coveo [case deflection panel](https://docs.coveo.com/en/2897/) is a [search interface](https://docs.coveo.com/en/2741/) that's meant to be embedded in a Service Portal record creation form. As the end user fills the form fields, the Coveo Case Deflection panel automatically updates to display the most contextually relevant [items](https://docs.coveo.com/en/210/) from a Coveo unified [index](https://docs.coveo.com/en/204/). The goal is to provide users with potential solutions prior to creating a case. When a user clicks a suggested item, they're redirected to the item page. > **Note** > > The Coveo Case Deflection panel, as its name indicates, is typically used to proactively suggest content to end users intending to create a support case. > However, this feature can be used with any record producer. > The procedure in this article explains how to add a Case Deflection panel to a case creation page, but you can follow and adapt it for any record creation page. ![Case Deflection Panel in ServiceNow showing search results for device heart rate issues | Coveo](https://docs.coveo.com/en/assets/images/coveo-for-servicenow/coveo-for-servicenow-case-deflection-panel.png) To add a Coveo Case Deflection panel to your ServiceNow record creation form . [Create and customize a Coveo hosted search page](#create-and-customize-a-coveo-hosted-search-page-for-coveo-case-deflection) for use in your Coveo Case Deflection panel. . [Add the Coveo Case Deflection panel](#add-the-coveo-case-deflection-panel) to a ServiceNow record creation form. ## Create and customize a Coveo hosted search page for Coveo Case Deflection Create a Coveo hosted search page that will be used to power the Coveo Case Deflection panel in your ServiceNow instance. How you create and customize a Coveo hosted search page for Case Deflection depends on your version of Coveo for ServiceNow. * For Coveo for ServiceNow version 25.1.5+: .. In the [Coveo Administration Console](https://docs.coveo.com/en/183/), on the [**Search Pages**](https://platform.cloud.coveo.com/admin/#/orgid/search/search-pages/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/search/search-pages/)) page, click **Add search page**. .. [Create and customize the Coveo hosted search page](https://docs.coveo.com/en/na2g0545#create-a-search-page) using the **Simple builder**. .. Once the hosted search page is created, on the [**Search Pages**](https://platform.cloud.coveo.com/admin/#/orgid/search/search-pages/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/search/search-pages/)) page, copy the **ID** of the search page, and paste it somewhere safe and accessible. You'll need to enter it in the ServiceNow interface later. * For versions of Coveo for ServiceNow prior to 25.1.5: .. In the [Coveo Administration Console](https://docs.coveo.com/en/183/), on the [**Search Pages**](https://platform.cloud.coveo.com/admin/#/orgid/search/search-pages/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/search/search-pages/)) page, click **Add search page**. .. In the **Add a search page** screen, click **Legacy Interface Editor** to [create a legacy hosted search page](https://docs.coveo.com/en/1656#legacy-search-page). > **Note** > > Take note of your search page name, as you'll need to enter it in the ServiceNow interface later. .. Customize the legacy hosted search page using the [Interface Editor](https://docs.coveo.com/en/1852/). ## Add the Coveo Case Deflection Panel The following procedure explains how a ServiceNow instance administrator or developer can add a Coveo Case Deflection panel to a Service Portal case creation form. . In the Now Platform UI of your ServiceNow instance: .. Navigate to **Service Portal** > **Pages**. .. Create a copy of your Service Portal display catalog item record (typically, this is the record whose **ID** is `sc_cat_item`) by clicking **Clone Page** in the upper-right corner of the record form. Then: *** If you want Coveo widgets to display in all catalog items, open the original catalog item record. The page copy will be your backup page. *** If you want Coveo widgets to display only in certain catalog items, open your copy of `sc_cat_item`. When using this method, ensure that the desired catalog items use this item record. .. In the **Related Links** section, click **Open in Designer**. . In the **Service Portal Designer**: .. Delete all widgets and all containers in the page, or reorganize them to make room for the widgets mentioned below. .. Add a two-column container. .. Drag the **SC Catalog Item** widget to the left column container. .. Click the **SC Catalog Item** widget you just added, and then click **Edit**. .. In the **Instance** dialog, deselect **Order Item Section On Top**, and then click **Save**. . In the right column, drag one of the following Coveo widgets inside the container. The widget to use depends on whether you [created the Coveo search page](#create-and-customize-a-coveo-hosted-search-page-for-coveo-case-deflection) using the **Simple builder** or **Legacy Interface Editor**. ** **Coveo Atomic Search Page** (Coveo for ServiceNow 25.1.5+): Use this widget if you created your Coveo search page using the **Simple builder**. ** **Coveo Case Deflection**: Use this widget if you created your Coveo search page using the **Legacy Interface Editor**. . At the upper-right corner of the Coveo widget, click ![Edit widget icon | Coveo for ServiceNow](coveo-for-servicenow/edit-widget-icon.png). . Specify the widget options: ** For the [**Coveo Atomic Search Page** options](https://docs.coveo.com/en/2853#coveo-atomic-search-page-widget-options), in the **Search Page ID** field, enter the ID of your Coveo search page. > **Note** > > You can find the **ID** of your Coveo hosted search page on the [**Search Pages**](https://platform.cloud.coveo.com/admin/#/orgid/search/search-pages/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/search/search-pages/)) page of the [Coveo Administration Console](https://docs.coveo.com/en/183/). ** For the [**Coveo Case Deflection** options](https://docs.coveo.com/en/2853#coveo-case-deflection-widget-options), in the **Hosted Search Page** field, enter the name of your Coveo search page. > **Note** > > You can find the **Name** of your Coveo hosted search page on the [**Search Pages**](https://platform.cloud.coveo.com/admin/#/orgid/search/search-pages/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/search/search-pages/)) page of the [Coveo Administration Console](https://docs.coveo.com/en/183/). . Optionally, specify other widget options as required. **Examples** * Use the **Scope** and **Component** options to name the widget according to your [naming convention](https://docs.coveo.com/en/3198#establish-a-widget-naming-convention). * You can use the **CSS classes** option to [define page-specific CSS rules](https://docs.coveo.com/en/2852#customize-the-css-of-a-widget) to modify how the Coveo search page renders on the page, such as to adjust the vertical alignment of the widget. . Click **Save** to save your widget options. . For navigation and search purposes, you can also add a two-column container with a **breadcrumbs** and a [**Coveo Searchbox** widget](https://docs.coveo.com/en/2853#searchbox) above the **SC Catalog Item** widget and Coveo Case Deflection panel. . The Coveo Case Deflection panel can provide on-the-fly contextual suggestions in the search results as text is typed in your case form. Perform the following steps to leverage this capability: .. In the UI of your ServiceNow instance, navigate to **Service Catalog** > **Catalog Definitions** > **Record Producers**. .. Find and open your case creation record producer. If the [ServiceNow Customer Service Management application](https://www.servicenow.com/docs/bundle/zurich-customer-service-management/page/product/customer-service-management/concept/c_CustomerServiceManagement.html) is installed, the record **Name** is typically `Create Case`. .. At the bottom of the record form, select the **Variables** tab. .. In the table: ... Find and delete the **Contextual Search Results** variable. > **Note** > > Assuming you have a [ServiceNow source](https://docs.coveo.com/en/2107/), you no longer require this variable. ... Click **New**. ... In the new record form that opens: .... In the **Type** dropdown menu: [cols="2",options="header"] |=== |For ServiceNow version |Select |Paris or earlier |**Macro** |Quebec or later |**Custom** |=== .... Select the **Question** tab and set the **Question** and **Name** fields to the name you want to give to the new variable (for example, `Coveo_case_deflection_panel`). .... Select the **Type Specifications** tab and set the **Widget** field to `Coveo Field Change`. This invisible widget provides the Coveo Case Deflection panel with any changes in the form fields as the user is typing. This information is used to contextualize the queries of the Coveo Case Deflection panel. .... Click **Submit**. .. Navigate to one of your Customer Service Portal service catalog items. If everything is set up properly, the Coveo Case Deflection panel should be visible in the case creation form and should automatically refresh as you type in the form fields. ## Configure your query pipeline Once you have implemented the widget in your ServiceNow instance, you must [link it to a query pipeline](https://docs.coveo.com/en/3198/) in your Coveo organization. . On the [**Query Pipelines**](https://platform.cloud.coveo.com/admin/#/orgid/search/pipelines/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/search/pipelines/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/search/pipelines/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/search/pipelines/)) page of the [Coveo Administration Console](https://docs.coveo.com/en/183/), do one of the following: ** Click an existing pipeline, and then click **Edit components** in the Action bar. ** [Create a new pipeline](https://docs.coveo.com/en/1791#create-a-query-pipeline) for your Coveo for ServiceNow widget to use. . In the query pipeline panel, [create a condition](https://docs.coveo.com/en/1959#create-a-condition) enforcing a specific search hub (`Search hub is`) for the pipeline. The filter value to enter depends on your widget configuration: ** If you didn't provide [Scope and Component values](https://docs.coveo.com/en/3198#establish-a-widget-naming-convention) in the widget options, enter `ServiceNow`. ** If you provided a scope and a component, enter them in the following format: `Scope_Component`. **Example** For a widget with a `Portal` scope and a `MyWidget` component, your condition value should be `Portal_MyWidget`. Your complete pipeline condition is therefore `Search Hub is Portal_MyWidget`. With such a condition, your pipeline will be used for all queries originating from the widget. > **Note** > > If your pipeline already has a condition, ensure to include this previous condition in your new one with an `OR` operator. > > For example, your pipeline has the following condition: `Search Hub is Portal_MyWidget`. > You want to link a new portal widget to this pipeline, so your new condition is `Search Hub is Portal_MyWidget OR Search Hub is Portal_MySecondWidget`. > With this condition, your pipeline will be used for all queries originating from one of these widgets. . In the query pipeline panel, select the **Advanced** tab, and then on the left side of the panel, click **Query parameters**. . Add a rule to override the [large query expression (lq)](https://docs.coveo.com/en/2830#large-query-expression-lq) parameter value so that it uses the textual data a user enters in the issue description field of the case creation form: .. Click **Add a query parameter rule**. .. In the **Add a query parameter rule** subpage, select **lq (large query expression)**, and then click **Next**. .. Under **lq (large query expression)**, enter the following rule to set the large query expression (lq) to the `name` attribute of the issue description field in the case creation form, which is `comments`: `<@+ $context.comments +@>` .. Under **Condition**, select or [create](https://docs.coveo.com/en/1959#create-a-condition) a `Query is empty` condition. .. Click **Add rule**. ## What's next? [Embed a Coveo Insight Panel in your case forms](https://docs.coveo.com/en/2113/) to empower your support agents with a dynamic and proactive search panel.