--- title: Integrate a Coveo Case Deflection component slug: '1163' canonical_url: https://docs.coveo.com/en/1163/ collection: coveo-for-salesforce source_format: adoc --- # Integrate a Coveo Case Deflection component [.version.c4sf.c4sf-edition.c4sf-pro-enterprise] [Pro and Enterprise editions](https://docs.coveo.com/en/l2590456#salesforce) > **Warning** > > Although the **Coveo Case Deflection** component is still available in the Coveo for Salesforce package, it's no longer the recommended approach for [case deflection](https://docs.coveo.com/en/2911/). > Instead, we recommend using the [Coveo Case Assist](https://docs.coveo.com/en/l2bg0226/) solution, which is specifically designed to optimize the case creation process and augment case deflection. The **Coveo Case Deflection** component increases self-service in Experience Cloud sites. As the user enters information into the Salesforce [Create Case Form](https://help.salesforce.com/articleView?id=sf.rss_case_creation.htm&type=5), the component automatically displays recommended solutions related to their issue. ![Case Deflection](https://docs.coveo.com/en/assets/images/coveo-for-salesforce/case-deflection-detailed.png) > **Important** > > Since the `CaseSubmit` event is recorded as a custom event, you must create a custom dimension for the `subject` and `description` to view this information in the **Visit browser** and analytics reports (see [Manage dimensions on custom metadata](https://docs.coveo.com/en/1522/)). ## Prerequisites * [Log in to Salesforce](https://login.salesforce.com) using an administrator account. * Ensure that your Salesforce organization is linked to your [Coveo organization](https://docs.coveo.com/en/185/) (see [Configure the Coveo for Salesforce application](https://docs.coveo.com/en/1153/)). * Ensure you've created a [Coveo Machine Learning (Coveo ML)](https://docs.coveo.com/en/188/) [Automatic Relevance Tuning (ART)](https://docs.coveo.com/en/1013/) [model](https://docs.coveo.com/en/1012/) and selected the [**Comply with Intelligent Term Detection (ITD)**](https://docs.coveo.com/en/l1ca1038#comply-with-intelligent-term-detection-itd) option. For instructions on how to create a Coveo ML ART model that's optimized for case deflection, see [Configure an Automatic Relevance Tuning model for Case Deflection or Case Assist Document Suggestions](https://docs.coveo.com/en/lc8b0514/). * Ensure that you've [created an Experience Cloud Site](https://help.salesforce.com/articleView?id=networks_creating.htm&type=5). > **Important** > > The only supported template is **Customer Service**. ## Step 1: Add the Coveo Case Deflection component in Salesforce . [Access the Salesforce **Experience Builder**](https://help.salesforce.com/articleView?id=community_designer_ui.htm&type=5). . Access the page where you want to insert your **Coveo Case Deflection** component, typically the **Contact Support** page. > **Tip** > > If you choose the **Contact Support** page, delete the existing Salesforce **Case Deflection** component before adding the Coveo component. . In the left sidebar, select the **Components** tab. . On the **Components** tab, under **Custom Components**, drag the **Coveo Case Deflection** component to the right of the **Contact Support Form**, in the **Sidebar** section. . At the upper-right corner of the page, click **Preview**. . In the **Coveo Case Deflection** component, click **Set Up a Search Page**. . Choose the tabs you want in your panel, and then select **Create Page**. You can always change the tabs later. ## Step 2: Configure your Case Deflection component in Coveo To configure the **Coveo Case Deflection** component, you must set a [query pipeline](https://docs.coveo.com/en/180/) to link your component to your [Coveo organization](https://docs.coveo.com/en/185/). . In your Coveo organization, select or [create a query pipeline](https://docs.coveo.com/en/1791#create-a-query-pipeline) that will be used by your **Coveo Case Deflection** component. > **Tip** > > Take note of the query pipeline name for a future step. . 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, click the query pipeline used by your **Coveo Case Deflection** component, and then click **Edit components** in the Action bar. . On the subpage that opens, select the **Advanced** tab, and then click **Query parameters** on the left side of the page. . On the **Query Parameters** tab, add rules overriding the [basic query expression (`q`)](https://docs.coveo.com/en/178/) and [large query expression (`lq`)](https://docs.coveo.com/en/214/) parameter values: .. Click **Add a query parameter rule**. .. On the **Add a query parameter rule** subpage, select **q (basic query expression)**, and then click **Next**. .. Under **q (basic query expression)**, enter `<@+ $context.subject +@>`. > **Important** > > If you enabled [query syntax](https://docs.coveo.com/en/1552/), remove the `<@\+` and `+@>` markers from the query parameter rules overriding the basic query expression (`q`) as follows: > `$context.subject`. .. Under **Condition**, select or [create](https://docs.coveo.com/en/1959#create-a-condition) a `Query is empty` condition. .. Click **Add rule** .. To add a rule overriding the large query expression (lq) parameter value, click **Add a query parameter rule** once again. .. On the **Add a query parameter rule** subpage, select **lq (large query expression)**, and then click **Next**. .. Under **lq (large query expression)**, enter `<@+ $context.description +@>`. .. Under **Condition**, select or [create](https://docs.coveo.com/en/1959#create-a-condition) a `Query is empty` condition. .. Click **Add rule**. Your **Query Parameters** rules should look like this: ![Query parameters rules output | Coveo](https://docs.coveo.com/en/assets/images/coveo-for-salesforce/query-parameter-rules-2.png) . [Enable the partial match feature](https://docs.coveo.com/en/414/) to allow the [index](https://docs.coveo.com/en/204/) to return [items](https://docs.coveo.com/en/210/) that don't necessarily match all the [keywords](https://docs.coveo.com/en/2738/) entered by the end user in the **Subject** box. ## Step 3: Route queries to the desired query pipeline Now that the query pipeline is configured to handle case deflection queries, ensure that every query originating from the **Coveo Case Deflection** component is routed to that query pipeline. The recommended and most flexible [query pipeline routing mechanism](https://docs.coveo.com/en/1666/) is [condition-based routing](https://docs.coveo.com/en/1666#condition-based-routing-recommended). In this scenario, search requests are authenticated with a search token that contains a [`searchHub`](https://docs.coveo.com/en/1075#searchhub-optional) parameter. Each query pipeline, except the default one, should have a distinct [query pipeline condition](https://docs.coveo.com/en/2793/) based on a specific [search hub](https://docs.coveo.com/en/1342/) value, such as **Search Hub is Case Deflection**. When using this routing mechanism, you ensure that search requests are routed according to the search interface from which they originate. ## What's next? For instructions on how to configure a custom search token that's generated server side for your **Coveo Case Deflection** component, see [Configure the search token for a Case Deflection component](https://docs.coveo.com/en/lb1f1380#configure-the-search-token-for-a-case-deflection-component).