In this blog, we will be discussing embedding predictions from Einstein Discovery into Tableau, using the new extension object available in Tableau Desktop (version 2021.1).
Predictions from Einstein Discovery can be embedded in Tableau by following three easy steps.
Prerequisites: Licenses and Software
- A CRM Analytics Plus or Einstein Predictions license from Salesforce. If your company’s org doesn’t have this, download an analytics-enabled Dev Org
- A Tableau Desktop license. If you don’t have this, you can start a 14-day trial
- Tableau Desktop v2021.1 or later

Step 1: Einstein Discovery Model Creation
The dataset used for this prediction can be found here (Superstore Sample Data). Upload the dataset into CRM Analytics and create a story.
- Field to Analyze: minimize ‘Days to Ship’
- Story type: Insights & Predictions
- Select “Automated” to let Einstein pick relevant fields for you
If you have not created an Einstein Discovery model before, please refer to this blog (https://www.springml.com/blog/my-einstein-discovery-toolkit-3-tips-to-get-started/) to understand the various parts of a story and steps to optimize a model (optional). At the very least, your model needs a few variables that have some correlation with the output.

Step 2: Create a Tableau Workbook
Now, we need to build a Tableau workbook with the same data set used to build the predictive model in Salesforce. You can download a partially completed Tableau Workbook here (location to download the dashboard without extension) to follow along with the steps of this tutorial. Watch our screen recording or follow the steps mentioned below to create a hidden Data Sheet and use it in the dashboard.- Step 2 – Adding a hidden data sheet

- Partially completed Dashboard preview. We will be adding the Einstein Discovery Extension in the blank space on the right side of the Dashboard

- Create a new sheet in Tableau
- From the Data pane on the left search for the variables. Then drag and drop in the “Text” box in Marks Card as shown. Name the sheet “Data Sheet”
- Add the Data Sheet to the dashboard. Make it floating and hide the sheet in the dashboard by setting its height and width to 1
- Create an ‘action filter’ to filter the data sheet when selections are made in other parts of the dashboard
Step 3: Embedding Einstein Discovery Model in Tableau
Before we can create the extension, we need to authorize a connection between Tableau and Salesforce.
- In Tableau Desktop select Help > Setting and Performance > Manage Analytics Extension Connection and select Einstein Discovery to enable extension connection to a Salesforce from Tableau

- A Salesforce access window will open in the browser directly and prompts to select the username to grant access for Tableau Desktop to communicate with the Prediction Model

- Create a new sheet in Tableau
- From the Data pane on the left search for the variables. Then drag and drop in the “Text” box in Marks Card as shown. Name the sheet “Data Sheet”
- Add the Data Sheet to the dashboard. Make it floating and hide the sheet in the dashboard by setting its height and width to 1
- Create an ‘action filter’ to filter the data sheet when selections are made in other parts of the dashboard


Now we can set up the extension
- Please use this video and steps stated below to set up the extension connection to the Discovery Model using an Extensions Object – Step 3-Einstein Discovery Prediction Setup

- Drag an Extension Object from the Object Shelf into the Dashboard. Select the Einstein Discovery extension and add it to the dashboard

- A configuration window will pop up. Select the Prediction definition (Predicted Days to Ship) we created in Step 1 and then the worksheet (Data Sheet) we created in Step 2 with all the variables we used in the model. Then click “Proceed”

- Verify all of the variables in the Workbook match to the variables within Salesforce and click “Next”

- Enter a label, units, and summarization function for the predictions. After making your selections click on the “Done” button. The prediction is now deployed in your Tableau desktop

Thanks to the hidden Data Sheet, whenever we make a selection in the rest of the dashboard our predictions will be updated automatically
What’s Next: Advanced Use Cases
Einstein Discovery predictions can be embedded into Tableau Calculated fields directly, and can be used in the visualizations. Follow along with this video or follow the below steps for creating a calculated field in Tableau using the Einstein Discovery Prediction:

- In Salesforce Analytics Studio > Model Manager > Predicted Days to Ship (Model created for this blog) > settings > Create Tableau Table calculation
- Copy the table calculation from the pop up window

- Create a Table Calculation in Tableau and name it “Predicated Days to Ship”. Paste the code from the previous step in the editor and click on the “OK” button to save it

- You can now use the calculated field “Predicated Days to Ship” to find the outliers in state by postal code and manufacturer
Now that we have seen how easily we can embed the predictive model in Tableau, let us see the limitations we have with the current dashboard extension.
Limitations:
- Worksheets allow you to get predictions for one or more rows of data (bulk predictions). You can get bulk predictions for up to only 50,000 rows of data at a time
- Parameters allow you to conduct interactive, “what if” predictive analysis on a single set of input values
View the link for More information about limitations and connections to ED
You now have your new embedded predictions in Tableau that will enable the end-user to have the power of predictive analytics with just a few clicks while eliminating codes that require more effort. The outcome is to give the user the best of both worlds of Salesforce and Tableau.