





















































[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:
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:
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:
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:
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:
The Asset Properties window gives the user the option to change the following features:
{
"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:
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.