Creating a Coveo Lightning Insight Panel

Pro and Enterprise editions only

Coveo for Salesforce 3 - May 2018

The Lightning Insight Panel is a search interface meant to be included in the sidebar of your Lightning Service Console and that suggests contextually relevant information to your agents. This panel is typically used to propose your support agents relevant solutions alongside their cases.

It is the Lightning Experience equivalent of the Coveo Classic Insight Panel (see Creating a Coveo Classic Insight Panel).

Typically, you want the Lightning Insight Panel to be accompanied by the Coveo Attached Results, as both components rely on each other.

This article shows the recommended way of integrating the Coveo Lightning Insight Panel and the Coveo Attached Results in your Lightning Service Console.

Prerequisites

  1. Ensure you have created a Lightning Service Console (see Lightning Service Console).
  2. Ensure you have set up a domain name for your organization (see Set Up a My Domain Name).
  3. Ensure you have installed and configured the Coveo for Salesforce V3 package (see Installing the Coveo for Salesforce Application).

Step 1 - Add the Coveo Lightning Insight Panel Component in Salesforce

When adding a Lightning Insight Panel component, you should always put it at the top right of the page to make it visible. It is recommended to place it beside your case information or your Live Agent chat session.

Adding a Lightning Insight Panel to a Case Page

  1. In Salesforce, access your Lightning Service Console, and open any of your cases.
  2. At the top right of the page, click the cog icon (), and select Edit Page.
  3. In the Lightning App Builder, drag the Record Detail from the right side of the page to the left side of the page.
  4. Drag and drop the Coveo Insight Panel component to the right side panel.

  5. Drag and drop the Coveo Attached Results component where you want it.

    It is recommended to place the Coveo Insight Panel and the Coveo Attached Results components where we can see both of them at the same time.

  6. At the top right, click Save.
  7. If not already done, activate the new page.
    1. Click Assign as Org Default.

      You can make these changes available as default, or edit the assignment rules to only activate this page for specific users or profiles.

    2. Once you are done with the assignment rules, click the Save button.

  8. Now that your page is saved, at the top right of the page, select Back.
  9. Select either the Coveo Insight Panel or Coveo Attached Results component, and select the Set Up a Search Page button.

  10. Choose the tabs you wish to have in your panel, and select Create Page. You can always change the tabs later.
  11. Repeat these steps for the other Coveo component in your right side panel.

Since you do not need the case you are currently working on to appear in your results, you should filter it out from the results by following these steps:

  1. On the Case page, click Setup and select Edit Page.
  2. After clicking anywhere on the Insight Panel, in the Record Fields, add the Case_CaseNumber field.
  3. In your Coveo Cloud administration console, in the Filters tab, click Add Rule.
    1. In the Add a Filter Rule page, under Query parameter, select cq (constant query)
    2. Under Query Filter, add the following code:
       NOT @sfcasenumber=$context.Case_CaseNumber
      
    3. Click Add Rule.

Adding a Lightning Insight Panel to a Live Agent Chat Page

  1. Ensure you have enabled Live Agent in your Salesforce organization.
  2. In Salesforce, access your Lightning Service Console, and open any of your Chat sessions.
  3. At the top right of the page, click the cog icon (), and select Edit Page.
  4. In the Lightning App Builder, on the Live Chat Transcript Record Page, drag and drop the Coveo Insight Panel component to the right side panel.
  5. At the top right, click Save.
  6. If not already done, activate the new page.
    1. Click Assign as Org Default.

      You can make these changes available as default, or edit the assignment rules to only activate this page for specific users or profiles.

    2. Once you are done with the assignment rules, click the Save button.

  7. Now that your page is saved, in the top right of the page, select Back.
  8. In the Insight Panel, select the Set Up a Search Page button.
  9. Choose the tabs you wish to have in your panel, and select Create Page. You can always change the tabs later.

You should now have a functional Coveo Lightning Insight Panel.

Step 2 - Configure Your Lightning Insight Panel Component in Coveo Cloud

  1. In your Coveo Cloud Administration Console (see Logging in to Coveo Cloud V2), select the query pipeline used by your Insight Panel and access the query pipeline Query Parameters (see Managing Query Pipeline Query Parameters).

    By default, your Insight Panel uses the Default pipeline .

  2. Note the name of your query pipeline, as you will need it later.

  3. In the Machine Learning tab, add 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).

  4. In the Query Parameters tab, add a rule overriding the large query (lq) parameter value:

    1. Click Add Rule, and then select Query Parameters With Code.
      1. In the Add a Rule With Code dialog, in the form editor box, enter the following rule:
        • For the Case Page:
          override query lq:"<@+ $context.Case_Subject $context.Case_Description +@>"
          
        • For the Live Agent Chat Page:
          override query lq:"<@+ $context.LiveAgent_AllVisitorMessages +@>"
          

          The context can either be: LiveAgent_LastVisitorMessage, LiveAgent_LastAgentMessage, LiveAgent_AllVisitorMessages, or LiveAgent_AllAgentMessages.

          The LiveAgent_AllVisitorMessages context value provides all the customers messages and context from which Coveo Machine Learning can identify relevant keywords. With LiveAgent_LastVisitorMessage, the previous messages context values are excluded. LiveAgent_LastAgentMessage and LiveAgent_AllAgentMessages context values only show agent results.

      2. Click Add Rule.
    2. In the Action bar, click More, and then select Select condition.

    3. Add a Condition that is applied when an empty query is performed (see Adding a Query Pipeline Condition to Be Applied on Empty Queries).

      You can use the same query pipeline for both of your Case and Live Agent chat pages, but you have to enter different SearchHub names, typically AgentCase and AgentChat.

      Ensure that, when adding the overriding rules in your Query Parameters for each Insight Panel, you create a condition Search hub is [SearchHub name] for each Search hub.

  5. Your Query Parameters tab should now look like this:

Depending on your use case, you must add the custom dimensions to make the search and click events metadata available in your usage analytics reports (see Managing Dimensions on Custom Metadata).

  • For the Case Page: add context_case_description and context_case_subject dimensions.
  • For the Live Agent Chat Page: add context_liveagent_allvisitormessages, context_liveagent_allagentmessages, context_liveagent_lastvisitormessage, or context_liveagent_lastagentmessage dimensions.

Using the Result Actions

Coveo for Salesforce 3.16 - August 2018

When you have already created your Lightning Insight Panel, you need to modify its associated Visualforce component to use quick actions:

  1. In Setup, search for and select Visualforce components.
  2. Click Edit next to your coveoLightningInsightPanel.
  3. In the Visualforce Markup, under <div class="CoveoResultActionsMenu">, add the following lines:

     <div class="CoveoResultActionsSendEmail"></div>
     <div class="CoveoResultActionsPostToFeed"></div>
    
  4. Click Save.

Send as Email

  1. Ensure that you enabled the Email-to-Case option (see Enable and Configure Email-to-Case).

    You should also create a Send Email quick action to be able to display the Send as Email icon (see Create a Send Email Quick Action for Cases)

  2. In Salesforce, access your Lightning Service Console, and open any of your cases.
  3. Ensure that you have access to the Email quick action tab in your cases in Salesforce.
  4. Select the Email action.
  5. Hover over a result in the Coveo Lightning Insight Panel and click the Send as Email icon (SendAsEmailIcon).

You should now see your recommended solution inserted in your email text box.

To customize your Send as Email component, see ResultActionsSendEmail Component.

Post to Feed

  1. In Salesforce, access your Lightning Service Console, and open any of your cases.
  2. Access the Chatter Salesforce component, and select the Post tab.
  3. Hover over a result in the Coveo Lightning Insight Panel and click the Post to Feed icon (SendAsEmailIcon).

To customize your Post to Feed component, see ResultActionsPostToFeed Component.

Send to Chat

You will not be able to use the Send to Chat component in two situations (see Lightning Live Agent Panel is broken [SPRING ‘19]):

  • After upgrading to Salesforce Spring ‘19 while staying with a Coveo for Salesforce version prior to 3.25
  • After upgrading to the Coveo for Salesforce version 3.26 (or up) while staying with the Salesforce Winter ‘18 version

If you do not want to uprade Coveo for Salesforce and Salesforce to their latest version, you must create a custom script using the following code to use the component again (see Adding JavaScript to the Coveo for Salesforce Lightning Components with Custom Code):

window.coveoCustomScripts['default'] = function() {
  var root = document.querySelector('.CoveoSearchInterface');
  Coveo.$$(root).on('ResultActionsEvents.onSendToLiveAgent', function(_evt, args) {
    args.args.message = { text: args.args.message };
  });
};
  1. Ensure you have enabled the Live Agent in your Salesforce organization.
  2. While you are in an active Live Agent chat session, you can hover over a result in the Coveo Lightning Insight Panel and click the Send to Chat icon (SendToChatIcon).

To customize your Send to Chat component, see ResultActionsSendLiveAgent Component.

Adding the Result Actions to the Full Search Page

  1. Access the Full Search page.
  2. Access the Edit mode of the Full Search page.
  3. In the menu on the left, select the cog icon to access the Result Templates tab.
  4. Choose the result template where you want to insert the Result Actions, and access the Code tab.
  5. Enter the following code under the <div class="coveo-result-frame> element:
     <div class="CoveoResultActionsMenu">
         <div class="CoveoAttachToCase" data-display-tooltip="true"></div>
         <div class="CoveoSalesforceQuickview"></div>
     </div>
    

What’s Next?

You can customize the Coveo Lightning Insight Panel by using the options panel (see Customizing the Lightning Insight Panel Options).

People also viewed