You are here:
Embed Service Analytics Sidebar Dashboards in a Salesforce Page
Add Service Analytics dashboards to Salesforce pages so your service team can get a complete view of their cases and take appropriate action.
Required Editions
| Available in Salesforce Classic and Lightning Experience. |
| Available with CRM Analytics, which is available for an extra cost in Enterprise, Performance, and Unlimited Editions. Also available in Developer Edition. |
| User Permissions Needed | |
|---|---|
| To use CRM Analytics templated apps: | Use CRM Analytics Templated Apps |
| To use Service Analytics: | Access Service Cloud Analytics Templates and Apps |
| To create and manage CRM Analytics apps: | Manage CRM Analytics Templated Apps |
| Edit CRM Analytics Dataflows | |
| To edit a dataset’s extended metadata (XMD) file: | Edit CRM Analytics Dataflows |
| To create a Visualforce page (for Salesforce Classic pages) | Customize Application |
| To create and save Lightning pages in the Lightning App Builder | Customize Application |
| To view Lightning pages in the Lightning App Builder | View Setup and Configuration |
Service Analytics includes three specialized dashboards—called sidebars—to give service agents instant access to visualizations of data about their cases.
- The By Customer sidebar gives agents a snapshot of their customers, including products, case reasons and priority, and CSAT.
- The By Similarity sidebar shows data about previous cases so agents can guide customer interactions based on what they did in similar cases.
- The By Case History sidebar provides a quick view of the lifecycle of a case so agents can be informed during customer conversations.
Administrators can embed them in a Salesforce page so agents can access Service Analytics seamlessly while they carry out their normal case work. For example, if your Salesforce makes the Service Cloud available through a service console, that’s an ideal place to embed the sidebar dashboards.
To embed a sidebar in Lightning Experience, use CRM Analytics Dashboard Components. Read the process in Embed Dashboards in Lightning Pages, then see Steps 3, 4, and 5 below to create the filter.
To embed a sidebar in Salesforce Classic, follow the steps here.
- Create a Visualforce page for each sidebar. Go to Setup and enter Visualforce Pages in the Quick Find box, then select Visualforce Pages, and click New. Enter a label with the name of the sidebar and, optionally, a description.
- Replace the text that appears when you open the editor with the following:
<apex:page standardController="case"> <wave:dashboard dashboardId="Your_dashboard_id" height="1000px" showTitle="false" filter="Filter_condition" /></apex:page>- Replace
Your_dashboard_IDwith the dashboard ID for the sidebar. You can find the dashboard ID by opening the sidebar in Service Analytics; the ID is the last 15 characters of the URL for the sidebar.
Depending on which sidebar you’re embedding, go to one of the following steps:- By Customer sidebar: Go to Step 3.
- By Similarity sidebar: Go to Step 4.
- By Case History sidebar: Go to Step 5.
- Replace
- If you’re creating a page for the By Customer sidebar, replace
filter="Filter_condition"with one of the following, then skip to Step 6.- If you’re embedding a sidebar dashboard from the Service Analytics (Classic) app
built with the old dashboard designer in a Salesforce Classic page, use this syntax:
filter="{'ServiceCase1': {'AccountId': ['{!case.AccountId}']}}". - If you’re using the latest version of Service Analytics based on the new dashboard
designer, use this syntax to embed the dashboard in a Salesforce Classic page:
filter="{'datasets' : {'ServiceCase1': [{'fields':['AccountId'], 'filter': { 'operator':'in', 'values': '{!case.AccountId}'} }]}}". - If you’re embedding a dashboard from the latest version of Service Analytics in a
Lightning Experience page, use this syntax:
filter=”{'datasets' : {'ServiceCase1': [{'fields':['AccountId'], 'filter': { 'operator':'in', 'values': ['$AccountId']} }]}}”.
In all cases, replace‘ServiceCase1’with the name of the Service Case dataset. To find the name, open a dashboard, hit Command+e to view the JSON for the dashboard, and search forServiceCase. The name of the dataset is appended with a numeral that’s incremented each time you create the app, such as‘ServiceCase2’. Enter the entire dataset name including the numeral. - If you’re embedding a sidebar dashboard from the Service Analytics (Classic) app
built with the old dashboard designer in a Salesforce Classic page, use this syntax:
- If you’re creating a page for the By Similarity sidebar, replace
filter="Filter_condition"with one of the following, then skip to Step 6.- If you’re using Service Analytics (Classic) with previous dashboards built with the
old dashboard designer, use this syntax to embed the dashboard in a Salesforce Classic
page:
filter="{'ServiceCase': {'Reason': ['{!case.Reason}'],'Product__c': ['{!case.Product__c}']}}”. - If you use the latest version of Service Analytics based on the new dashboard
designer, use this syntax to embed the dashboard in a Salesforce Classic page:
filter="{'datasets' : {'ServiceCase1': [ {'fields':['Reason'], 'filter': { 'operator':'in', 'values': '{!case.Reason}'}}, {'fields':['Product__c'], 'filter': { 'operator':'in', 'values': '{!case.Product__c}' }} ]}}". - If you’re embedding a dashboard from the latest version of Service Analytics in a
Lightning Experience page, use this syntax:
filter=”{'datasets' : {'ServiceCase1': [{'fields':['Reason'], 'filter': { 'operator':'in', 'values': ['$Reason']}}, {'fields':['Product__c'], 'filter': { 'operator':'in', 'values': ['$Product__c'] }} ]}}”.
In all cases, do the following.
- Replace
‘ServiceCase1’with the name of the Service Case dataset. See Step 3 to learn how to find the name. - Replace
‘Product_c’with the API name of the custom field you use to track products. This field is the answer you selected in the configuration wizard, Page 2, Question 4. Find the API name of this field by going to Setup and typingCasesin the Quick Find box. Then click Fields and review your custom field names to find the field you use for products. Look for the API name of the field, and use that in place of‘Product_c’in both places in the query.
If you use a custom field to track case reasons, replace
‘Reason’with the API name of your custom field. Find the API name using the same technique you use for finding the custom field you use to track products. - If you’re using Service Analytics (Classic) with previous dashboards built with the
old dashboard designer, use this syntax to embed the dashboard in a Salesforce Classic
page:
- If you’re creating a page for the By Case History sidebar, replace
filter="Filter_condition"with one of the following, then skip to Step 6.- If you’re using Service Analytics (Classic) with previous dashboards built with the
old dashboard designer, use this syntax to embed the dashboard in a Salesforce Classic
page:
filter="{'ServiceCase1': {'Id': ['{!case.Id}'], 'OwnerId' : ['{!case.OwnerId}'], 'Product__c' : ['{!case.Product__c}'], 'Reason' : ['{!case.Reason}']}}". - If you’re using the latest version of Service Analytics based on the new dashboard
designer, use this syntax to embed the dashboard in a Salesforce Classic page:
filter="{'datasets' : {'ServiceCase1': [ {'fields':['Id'], 'filter': { 'operator':'in', 'values': '{!case.Id}'} }]}}". - If you’re embedding a dashboard from the latest version of Service Analytics in a
Lightning Experience page, use this syntax:
filter=”{'datasets' : {'ServiceCase1': [ {'fields':['Id'], 'filter': { 'operator':'in', 'values': ['$Id']} }]}}”.
Also do the following:
- Replace
‘Product__c’with the name of the custom field you use to track product family. See Step 4 to learn how to find the name of that field. - Replace
‘Reason’with the API name of the field you use to track the case reason. This field is the answer you selected in the configuration wizard, Page 2, Question 5. Find the API name of this field by going to Setup and typingCasesin the Quick Find box. Then click Fields and review your custom field names to find the field you use for case reason. Look for the API name of the field, and use that in place of‘Reason’in the query
In all cases, replace
‘ServiceCase1’with the name of the Service Case dataset. See Step 3 to learn how to find the name. - If you’re using Service Analytics (Classic) with previous dashboards built with the
old dashboard designer, use this syntax to embed the dashboard in a Salesforce Classic
page:
- Save the page, and open it in preview mode to be sure it shows the dashboard.
- Add the page to the console or whatever page you prefer in Salesforce. Through Setup,
find the specific page layout you want to include the sidebar. For example, some customers
use a page layout for information from the Cases object. In that case, enter
Casesin the QuickFind box in Setup, then open Page Layouts under Cases, and look for the page layout you want to edit. - Click Edit Layout and select the Custom Console Components tab near the top. Go the Right Sidebar section and select one of the pages you just created. First, select Visual Force page from Type, then select the page you just created from the Component drop-down. Enter a label.
- Set the width to 450px and save the layout. The sidebar should appear embedded in the page you just edited.
- Repeat this step with the other two sidebars, as needed.

