4 min read

[box type=”note” align=”” class=”” width=””]The following excerpt is taken from the book Learning Einstein Analytics written by Santosh Chitalkar. This book highlights the key techniques and know-how to unlock critical insights from your data using Salesforce Einstein Analytics.[/box]

With Einstein Analytics, users have the power to embed their dashboards on various third-party applications and even on their web applications. In this article, we will show how to embed an Einstein dashboard on Salesforce Classic.

In order to start embedding the dashboard, let’s create a sample dashboard by performing the following steps:

  1. Navigate to Analytics Studio | Create | Dashboard.
  2. Add three chart widgets on the dashboard.
  3. Click on the Chart button in the middle and select the Opportunity dataset. Select Measures as Sum of Amount and select BillingCountry under Group by. Click on Done.
  4. Repeat the second step for the second widget, but select Account Source under Group by and make it a donut chart.
  5. Repeat the second step for the third widget but select Stage under Group by and make it a funnel chart.
  6. Click on Save (s) and enter Embedding Opportunities in the title field, as shown in the following screenshot:

Salesforce dashboard

Now that we have created a dashboard, let’s embed this dashboard in Salesforce Classic. In order to start embedding the dashboard, exit from the Einstein Analytics platform and go to Classic mode. The user can embed the dashboard on the record detail page layout in Salesforce Classic. The user can view the dashboard, drill in, and apply a filter, just like in the Einstein Analytics window. Let’s add the dashboard to the account detail page by performing the following steps:

Navigate to Setup | Customize | Accounts | Page Layouts as shown in the following screenshot:

Page layout

Click on Edit of Account Layout and it will open a page layout editor which has two parts: a palette on the upper portion of the screen, and the page layout on the lower portion of the screen. The palette contains the user interface elements that you can add to your page layout, such as Fields, Buttons, Links, and Actions, and Related Lists, as shown in the following screenshot:

Account layout

Click on the Wave Analytics Assets option from the palette and you can see all the dashboards on the right-side panel.

Drag and drop a section onto the page layout, name it Einstein Dashboard, and click on OK.

Drag and drop the dashboard which you wish to add to the record detail page. We are going to add Embedded Opportunities.

Click on Save. Go to any accounting record and you should see a new section within the dashboard:

Embedding opportunities

Users can easily configure the embedded dashboards by using attributes. To access the dashboard properties, go to edit page layout again, and go to the section where we added the dashboard to the layout. Hover over the dashboard and click on the Tool icon. It will open an Asset Properties window:

Asset properties

The Asset Properties window gives the user the option to change the following features:

  • Width (in pixels or %): This feature allows you to adjust the width of the dashboard section.
  • Height (in pixels): This feature allows you to adjust the height of the dashboard section.
  • Show Title: This feature allows you to display or hide the title of the dashboard.
  • Show Sharing Icon: Using this feature, by default, the share icon is disabled. The Show Sharing Icon option gives the user a flexibility to include the share icon on the dashboard.
  • Show Header: This feature allows you to display or hide the header.
  • Hide on error: This feature gives you control over whether the Analytics asset appears if there is an error.
  • Field mapping: Last but not least, field mapping is used to filter the relevant data to the record on the dashboard. To set up the dashboard to show only the data that’s relevant to the record being viewed, use field mapping. Field mapping links data fields in the dashboard to the object’s fields. We are using the Embedded Opportunity dashboard. Let’s add field mapping to it. The following is the format for field mapping:
{

"datasets": {

"datasetName":[{

"fields":["Actual Field name from object"],

"filter":{"operator": "matches",

"values":["$dataset

Fieldname"]}

}]

}

Let’s add field mapping for account by using the following format:

{

"datasets": {

"Account":[{

"fields":["Name"],

"filter":{"operator": "matches",

"values":["$Name"]}

}]

}

}

If your dashboard uses multiple datasets, then you can use the following format:

{

"datasets": {

"datasetName1":[{

"fields":["Actual Field name from object"],

"filter":{"operator": "matches",

"values":["$dataset1

Fieldname"]}

}],

"datasetName2":[{

"fields":["Actual Field name from object"],

"filter":{"operator": "matches",

"values":["$dataset2

Fieldname"]}

}]

}

Let’s add field mapping for account and opportunities:

{

"datasets": {

"Opportunities":[{

"fields":["Account.Name"],

"Filter":{"operator":

"Matches",

"values":["$Name"]}

}],

"Account":[{

"fields":["Name"],

"filter":{"operator": "matches",

"values":["$Name"]}

}]

}

}

Now that we have added field mapping, save the page layout and go to the actual record. Observe that the dashboard is getting filtered now per record, as shown in the following screenshot:

Embedding opportunities

To summarize, we saw it’s fairly easy to embed your custom dashboards in Salesforce. Similarly, you can do so on other platforms such as Lightning, Visualforce pages, and even on your websites and web applications. If you are keen to learn more, you may check out the book Learning Einstein Analytics.

Learning Einstein Analytics

 

 

Data Science Enthusiast. A massive science fiction and Manchester United fan. Loves to read, write and listen to music.

LEAVE A REPLY

Please enter your comment!
Please enter your name here