Start tracking your progress
Trailhead Home
Trailhead Home

Understand How Templates Work

Learning Objectives

After completing this unit, you’ll be able to:
  • Describe Einstein Analytics apps and templates.
  • List the files that make up an Analytics Template
  • Create an app from a template and understand its contents.

If Apps Are Houses, Templates Are Blueprints

Before getting into the details of template development, a bit of architecture to help you understand how apps and templates are related.

You know how a house plan works, right? An architect draws one up, then builders use the same basic plan for several houses, each with their own specific features to suit the buyer. Each house follows the same basic plan, but one combines the kitchen and family room. Or another has extra closets or a larger bathroom. Another has larger windows and more doors. And each of them uses slightly different finishing materials—shingles, stucco, clapboard, brick, wood panels.

That’s the way templates work, too. A development team starts by creating an app—a collection of Analytics datasets, dashboards, lenses, and a dataflow.

Ingredients of an Analytics app

They create a template from the app using Analytics Templates, and the template becomes a blueprint for the app. The “plan” for the app is expressed in the form of a template object, which is made up of several JSON files.

Other organizations can then use that blueprint to create their own versions of the app. But they can create the app using data from their Salesforce org according to their own analytics needs. They might want to add Salesforce objects or use custom security settings. Or filter customer data based on different fields or terminology. Or create fewer or more dashboards.

Salesforce has created a wide variety of templates. We started with broad, general-purpose templates that create the Sales and Service Analytics apps. More recently, we’ve added templates for apps with more focused purpose, such as Campaign, Change, Retail Banking, and Health Cloud Analytics.

Each template is based on an app with datasets, dashboards, and lenses created by the Einstein Analytics development team. You use our templates to create your own versions of the apps to analyze Salesforce data. If you’ve spent any time working with Salesforce Analytics, perhaps you’ve created your own apps and your teams are using them as we speak.

One other point about templates: They’re more useful for apps that analyze data from Salesforce. You can create templates for apps that use non-Salesforce data. But they’re much more complex and require more work to get the non-Salesforce data into Analytics. For the purposes of this module, we’re going to use an app that includes only Salesforce data.

Anatomy of a Template

You and your analytics team just shed blood, sweat, and tears creating the Execs Only app. With Analytics Templates, you create a template based on the app to save others the trouble you just went through. Creating a template is just part of the process on the way to distributing your app. We don’t show how to create a template here. To jump-start the learning process, we’ve created the templates used for the examples in this module. They’re in the download file we mentioned in the Resources section of the previous unit.



You can learn the template creation process in the Analytics Templates Developer Guide. See Resources at the end of this unit.

The original app you create is known as the “master app” for the purposes of creating a template. Our master app is the Execs Only app that the DTC CEO is so crazy about. We’ve used that app for all the examples that follow.

As shown here, you can create one template from each master app. Others can then use the template to create multiple instances of the app. (Just in case you were curious, you can’t create a new template based on an app created from a template.)

One Analytics template can create many instances of the same app

One Template, Many App Variations

Templates can include configuration wizards—optional but highly useful additions that let admins customize the app. Wizards guide you through creation of the app, asking you questions about how you store data in your Salesforce org and how you’d like to view the data in your app. You make selections that determine how the app you create modifies the original. Many of the Salesforce templates, for example Sales Analytics, include wizards. It’s likely that every customer creates a slightly or significantly different version of Sales Analytics. But every Sales Analytics customer starts with the same app template.

It’s also likely that you want to let partners use a wizard to set up the Execs Only app to meet their specific Analytics needs. To do that, you modify the JSON files that define the template. The JSON files open a world of flexibility and power in the template creation universe. They contain the instructions the Analytics platform uses to create the app. When you create the Sales Analytics app, Analytics looks at the JSON files’ contents, including your wizard selections. It follows instructions in the JSON to create the app.

You’ll get to know a lot more about the JSON files in the next units. (And if you want to skip ahead, complete details about them and template development can be found in Templates Developer Guide. See the Resources section.) Along the way, we give you examples of how to edit the JSON to create your own templates. You won’t create them yourselves for now—that’s for another day. Toward those ends—and to speed things up—we’ve cheated a little and created a template based on the DTC Execs Only app. Our template creates an app with just the Sales and Pipeline Performance dashboards.

Let’s see how that works!

Create the App from a Basic Template

Log in to the special Developer Edition org you set up in the last unit, and select Analytics Studio from the app picker.



The first time you open Analytics Studio, the Welcome screen appears, offering resources to help you get started. You can dismiss it now, and open it again anytime from the Help menu. Click the question mark at upper right to open the menu. Click the question mark to open the Analytics Studio Help menuThen select Welcome to Analytics.



If Analytics Studio doesn’t open, check to see if your pop-up blocker is on. If so, change the setting to allow pop-ups from your org.

You’re ready to create the Execs Only app from the template.

  1. Click Create and select App.The Analytics create app button and selector
  2. Select Start from Template, then click Continue.
  3. Look at all the Analytics templates you can choose from! Scroll through the list until you find Execs Only Template 1, select it, and click Continue. Be sure to select Template 1.
  4. Click Continue until you get to a screen where you can name your app. Enter the name Exec App 1 and click Create. That brings up the app creation progress screen. It shows you what Analytics does behind the scenes while it creates the app.

While waiting for your app to be created (it takes a minute or two—not instantaneous, but a lot quicker than developing your own app!), a brief aside: You probably noticed that Execs Only Part 1 doesn’t have a wizard. That’s because we haven’t added the necessary code to the JSON files to add questions, variables, and so on. We’ll show you how to edit the JSON to add a wizard in the next unit.

Also, normally you wouldn’t have two versions of a template in an org. We’ve provided two versions of the Execs Only app template to demonstrate the power of templates. You’ll see what Execs Only Template 2 does in a later unit.

The Basic Execs Only App

When you see the message Application Complete at the end of the app creation steps, refresh the page to get to the app. You’ll see something like this:The Execs Only basic app dashboards and datasets list

Your basic version of Execs Only has two dashboards and several datasets. Click Run App at upper right. Now you can see just what the DTC CEO and your partners fell in love with. The dashboard widgets at top, Pipeline Performance and Sales Performance, give a high-level view of how DTC sales are going for the selected period. Further down, lots of detail. And all in a single, scrollable view. Nice!

Execs Only Pipeline Performance dashboard


Don't worry if your dashboards look a bit different from the examples here. The basic elements of the dashboards should be the same even though the data may differ.

To see how the dashboard works, change the date filter at the top from This Quarter to This Year. Then click the Pipeline Generated side of the toggle below Top Deals. The widgets refresh themselves based on your selection. You can see why people like this so much—lots of analysis in a couple of visualizations, easy to get different views of it. Cool!



Data may be missing from your dashboards. To correct this, follow the steps in the optional section “Sync Analytics Data with Trailhead Data Manager” before the multiple choice questions section. You don’t have to follow these steps to complete your badge.

In the next units, we’re going to look closely at the template files themselves. Then, we’ll make the template—and the app you create from it—more fully functional. We’re going to take our basic template and make a few simple, but powerful changes, adding configuration wizard questions that give DTC partners power to customize their version of the app.

For now, answer the questions below to continue the quest to earn your badge.

Optional: Refresh Analytics Data with the Trailhead Data Manager

You just created your app. Congrats! You can see all the basic parts of your app dashboards, but some of them may be missing data. If you’d like to view all the data in the right place, you can run the Trailhead Data Manager. It’s optional for completing your badge, but your dashboards look much better. In the “real world,” you never have to do this when you create an app with your own license. We invite you to blast through without thinking about it too much.


Be sure you can see the dashboards for your app before running the Trailhead Data Manager. Remember, you only need to run the data manager in Trailhead. You won’t have to use it to set up an app in your own org.

The first part of the process includes refreshing data and then running your app’s dataflow.

  1. From Analytics Studio, go to the app picker at upper right and select Trailhead Data Manager. You may have to scroll down to find it.Trailhead Data Manager in app picker
  2. Select the Trailhead Data Manager link below Items.
  3. On the Trailhead Data Manager home page, select Trailhead Data Manager.
  4. On the next page, click Refresh DTC Data.
  5. Now run the app dataflow. Go back to Analytics Studio by selecting it from the app picker.
  6. Click the gear icon in the upper right, and select Data Manager. (You’re opening the Analytics Data Manager, not to be confused with the Trailhead Data Manager.) From the menu in the upper left, select Dataflow View.
  7. Look for the name of your app. Open the menu on the far right across from the app name, and select Start.
  8. From the menu in the upper left, select Dataflow View. You can see the status of the dataflow to the right of your app name at the top of the list of jobs. Click the refresh button a few times until the status changes from Running to Successful. (If you see a warning message, ignore it and keep going. It won’t hurt your app’s data.)
  9. Next, you download and import a CSV file called Quota so that data about quotas appears in your app. You also use the Trailhead Data Manager to do that.


    In real life, you only have to add quotas data to your app if you store it in a tool outside Salesforce and want to view the data in Analytics. This is sometimes the case for Sales Analytics app customers.

  10. Go back to the Trailhead Data Manager. Click the app picker to find it.
  11. Click the Quota Data circle, and then click Download Quota CSV.
  12. Save the file, ‘DTC_Quota.csv’ in your Downloads directory.
  13. In the app picker, select Analytics Studio and open your app.
  14. Scroll down to see all the datasets, and locate the Quota dataset.
  15. Click the arrow to the far right of the dataset name and click Edit. If you’re viewing dataset icons, hover over the Quota dataset, click the arrow in the upper right corner, and click Edit.
  16. In the next window, click Replace Data in the upper right-hand corner.
  17. That takes you to the Replace Dataset Data page. Click Select file or drag file here….
  18. Find and select the DTC_Quota.csv file and click Next.
  19. Click Next on the next page, too, then Upload File on the next page.
  20. Finally, click Replace and Got It. (The last few pages let you fine-tune your data before you upload it into a dataset, but that’s a subject for a different day. If you want to learn more about importing data to Analytics, see the Analytics Data Integration Basics Trailhead module.)
  21. Finally, rerun the dataflow to be sure that the quotas data appears in your app. Repeat Steps 5 through 7.