Integrating a Coveo Case Deflection Component

Pro and Enterprise editions only

Pilot Feature in 3.10 Generally Available in 3.29+

The Coveo Case Deflection component increases self-service in a Salesforce Community. As the user enters information into the Salesforce Create Case Form, the Coveo Case Deflection component automatically displays recommended solutions related to their issue.

As of Coveo for Salesforce 3.16, the CaseSubmit event is recorded as a custom event. You have to create new custom dimensions for subject and description to be able to view this information in the Visit Browser and your analytics reports (see Manage Dimensions on Custom Metadata).

Requirements

  1. Log in to Salesforce using an administrator account.

  2. Ensure that your Salesforce Organization is linked to a Coveo organization (see Configuring the Coveo for Salesforce Application).

  3. Ensure that you have created a new community (see Create Communities).

    When creating a community, the only supported template is Customer Service.

Step 1: Add the Coveo Case Deflection Component in Salesforce

  1. Access your Community Builder (see Navigate Community Builder).

  2. Access the page where you want to insert your Coveo Case Deflection component, typically the Contact Support page.

    If you choose the Contact Support page, delete the existing Salesforce Case Deflection component before adding the Coveo component.

    If you’re using an older community version created before Spring ‘18, ensure that you replace the Salesforce Create Case Form component with the Salesforce Contact Support Form (see Migrate to the Contact Support Form and Case Deflection Components).

  3. In the left sidebar, select the Components tab.

  4. In the Components tab, under Custom Components, drag the Coveo Case Deflection component and drop it on the right side of the Contact Support Form, in the Sidebar section.

  5. At the top right of the page, click Preview.

  6. In the Coveo Case Deflection component, click Set Up a Search Page.

  7. Choose the tabs you want to have in your panel and select Create Page. You can always change the tabs later.

Now that you have your Coveo Case Deflection component, you must set a query pipeline to link your component to your Coveo organization.

Step 2: Configure Your Case Deflection Component in Coveo Cloud

The process of configuring the Case Deflection Component in Coveo Cloud slightly differs depending on the Coveo for Salesforce version you’re using:

Coveo for Salesforce 3.16 and Later Versions

  1. In your Coveo organization, select or create the query pipeline used by your Case Deflection Component.

    You should note the query pipeline name you entered for a further step.

  2. In the Machine Learning tab, add a new Coveo Machine Learning (Coveo ML) model, such as an Automatic Relevance Tuning (ART) model, with the Enable Intelligent Term Detection (ITD) option selected (see Activating Machine Learning Intelligent Term Detection (ITD) in Salesforce).

  3. In the Query Parameters tab, add rules overriding the basic query expression (q) and the large query expression (lq) parameter values:

    1. Click Action-Menu, and then select Add query parameters rule with code.

    2. On the Add a Rule With Code subpage, in the form editor box, enter the following rules:

       override query q:"<@+ $context.subject +@>"
      
       override query lq:"<@+ $context.description +@>"
      

      If you enabled the query syntax in your Case Deflection Component, you must remove the <@+ and +@> markers from the query parameter rule overriding the basic query expression (q). When the query syntax is enabled, you must enter the following rules:

       override query q:"$context.subject"
      
       override query lq:"<@+ $context.description +@>"
      
    3. Click Add With Code.

    4. Back in the Query Parameters tab, click the created rules, and then in the action bar, click Edit.

    5. In the Edit a Query Parameter Rule subpage that opens, under Condition, select or create a condition that applies when an empty query is performed.

    6. Click Save.

    Your Query Parameters tab should now look like this:

Coveo for Salesforce Versions Prior 3.16

  1. In your Coveo organization, select or create the query pipeline used by your Case Deflection Component.

    You should note the query pipeline name you entered for a further step.

  2. In the Machine Learning tab, add a new Coveo Machine Learning (Coveo ML) model, such as an Automatic Relevance Tuning (ART) model, with the Enable Intelligent Term Detection (ITD) option selected (see Activating Machine Learning Intelligent Term Detection (ITD) in Salesforce).

  3. In the Query Parameters tab, add rules overriding the basic query expression (q) and the large query expression (lq) parameter values:

    1. Click Action-Menu, and then select Add query parameters rule with code.

    2. On the Add a Rule With Code subpage, in the form editor box, enter the following rules:

       override query q:"<@+ $context.Subject +@>"
      
       override query lq:"<@+ $context.Description +@>"
      
      • If you enabled the query syntax in your Case Deflection Component, you must remove the <@+ and +@>markers from the first query parameters rule. When the query syntax is enabled, you must enter the following rules:

          override query q:"$context.Subject"
        
          override query lq:"<@+ $context.Description +@>"
        
      • As of Coveo for Salesforce 3.16, the field names are modified in snake case format (see Snake Case)

          override query lq: "<@+ $context.My__CUSTOM_Description__c +@>"
        

        must become

          override query lq: "<@+ $context.my_custom_description +@>"
        
      • To add a customData field in a version prior to Coveo for Salesforce 3.16, the field name has to be exactly the selected Salesforce custom field name (see Create Custom Fields).

    3. Click Add With Code.

    4. Back in the Query Parameters tab, click the created rules, and then in the action bar, click Edit.

    5. In the Edit a Query Parameter Rule subpage that opens, under Condition, select or create a condition that applies when an empty query is performed.

    6. Click Save.

    Your Query Parameters tab should now look like this:

  1. In Salesforce, in Setup, search for and select Visualforce Components.

    With Salesforce Lightning With Salesforce Classic
    Under Platform Tools, select Custom Code > Visualforce Components. Under Build, select Develop > Visualforce Components.
  2. Next to your Case Deflection component, typically communityCaseDeflectionCoveo, select Edit.

  3. In the Visualforce Markup tab, search for the ... class="CoveoSearchInterface" ... element.

  4. Inside this element, add the following code:

    data-pipeline="NameOfYourPipeline"
    

    The NameOfYourPipeline represents the name of the query pipeline that you selected in step 2 (see Step 2: Configure Your Case Deflection Component in Coveo Cloud).

Your Coveo Case Deflection component should now be linked to your Coveo organization and your query pipeline.

You must add the value and the field custom dimensions to make the events metadata available in your usage analytics reports (see Manage Dimensions on Custom Metadata).

What’s Next?

For more information about the Search Interface, see Coveo SearchInterface Component

Recommended Articles