Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Understand How Templates Work

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe CRM Analytics apps and templates.
  • List the files that make up a CRM 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 specific features to suit the buyer. Each house follows the same basic plan, but one combines the kitchen and family room. Another has extra closets or a larger bathroom. Another has larger windows and more doors. And each uses slightly different finishing materials—shingles, stucco, clapboard, brick, or wood panels.

That’s the way templates work, too.

Ingredients of a CRM Analytics app

A development team starts by creating an app—a collection of Analytics datasets, dashboards, lenses, and recipes or dataflows. Using Analytics Templates, they make a template from the app that becomes a blueprint for new apps. The “plan” for the app is expressed in the form of a template object, which consists of several JSON files.

Other organizations then use that blueprint to create versions of the app that use data from their Salesforce org according to their analytics needs. They might want to add Salesforce objects, use custom security settings, filter customer data, or create fewer or more dashboards.

Salesforce has created a wide variety of templates. These templates started with broad, general-purpose templates that make the Sales and Service Analytics apps. More recently, templates for apps with more specific purposes have been added, 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 CRM Analytics development team. You can use these templates to create versions of the apps to analyze Salesforce data. If you’ve worked with CRM Analytics, perhaps you’ve developed apps, and your teams are using them.

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 CRM Analytics. For this module, you use an app that includes only Salesforce data.

Anatomy of a Template

You and your analytics team put much effort into creating the Execs Only app. With CRM Analytics Templates, you create a template based on the app to save others the trouble you went through. Creating a template is just part of the process towards distributing your app. This unit doesn’t show you how to create a template. To jump-start the learning process, you can download the templates used for the examples in this module. They’re mentioned in the Resources section of the previous unit.

Note

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

The app you build the template for is known as the “source app.” Your source app is the Execs Only app. That app is used for all the examples that follow.

As shown here, you can create one template from each source app. Others can then use the template to create multiple instances of the app. (If you’re curious, you can’t make a template based on an app created from a template.)

Diagram showing that the source app is used to create the template, and the template is used to create app instances.

One Template, Many App Variations

A template can include a configuration wizard—an optional but handy addition that lets admins customize the app. Wizards guide you through the creation of the app, asking questions about how you store data in Salesforce and how you want to view the data in the app. You make selections that determine how the app modifies the original. Many of the Salesforce templates, for example, Sales Analytics, include wizards. Every customer probably creates a different version of Sales Analytics. However, every Sales Analytics customer starts with the same app template.

You also likely want to let partners use a wizard to set up the Execs Only app to meet their CRM 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 CRM Analytics platform uses to create the app. When you create the Sales Analytics app, CRM Analytics looks at the instructions in the JSON files, including your wizard selections, to create the app.

The following units introduce you to more about the JSON files. (If you want to skip ahead, you can find complete details about template development and the JSON files in the CRM Analytics Templates Developer Guide. See the Resources section.) Along the way, you see examples of how to edit the JSON to create templates. You don’t create the files—that’s for another day. Toward those ends—and to speed up things—your Developer Edition org includes a template based on the DTC Execs Only app. This template creates an app with the Sales and Pipeline Performance dashboards.

Create the App from a Basic Template

To see how the template works, log in to the special Developer Edition org you set up in the last unit and select Analytics Studio from the app launcher.

Tip

Tip: The first time you open Analytics Studio, the Welcome screen appears, offering resources to help you get started. You can dismiss it now. To open it anytime, click the question mark at the upper right to open the Help menu, then select Welcome to CRM Analytics.

The question mark you click to open the Analytics Studio Help menu

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

  1. Click Create and select App

The CRM create app button and selector

  1. Take a moment to look at the CRM 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.
  2. Click Continue until you reach the screen where you name the app. Enter the name Exec App 1 and click Create. That brings up the app creation progress screen. It shows you what CRM Analytics does behind the scenes while it creates the app.

While waiting for CRM Analytics to create your app (it can take a few minutes, but is quicker than developing your own), a brief aside: You probably noticed that Execs Only Part 1 doesn’t have a wizard. That’s because the necessary code to add questions, variables, and so on hasn’t been added to the JSON files. You see how to edit the JSON to add a wizard in the next unit.

Usually, you wouldn’t have two versions of a template in an org. Your Developer Edition org has two versions of the Execs Only app template to demonstrate the power of templates. You 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 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 the upper right. Now you can see what the DTC CEO and your partners fell in love with. The dashboard widgets at the top—Pipeline Performance and Sales Performance—give a high-level view of DTC sales for the selected period. Further down, lots of detail. And all in one, scrollable view.

Execs Only Pipeline Performance dashboard

Note

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

Also, data may be missing from your dashboards. To correct this issue, follow the optional steps in “Refresh CRM Analytics Data with Trailhead Data Manager.” You don’t have to follow these steps to complete your badge.

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

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

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

Optional: Refresh CRM Analytics Data with the Trailhead Data Manager

You just created your app. Congrats! You can see all the essential parts of your app dashboards, but some may be missing data. If you haven't recently created your Developer Edition org, run the Trailhead Data Manager to ensure you’re viewing all the data in the right place. It’s optional for completing your badge, but the dashboards look better. You never have to do this in the real world when you create an app.

Important

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

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

  1. In Analytics Studio, go to the app launcher at the upper right and select Trailhead Data Manager. You may have to scroll to find it.
  2. Select the Trailhead Data Manager tab and click Refresh DTC Data. After the refresh completes, it's time to run the app dataflow.
  3. From the App Launcher ( App Launcher icon), open Data Manager. (You’re opening the Data Manager, not to be confused with the Trailhead Data Manager.)
  4. Click Manage Dataflows. 

The Managed Dataflow option in the list of options in Analytics Studio.

  1. Click the Connect tab, then click the dropdown to the right of SFDC_LOCAL, and select Run Now. This action kicks off data sync jobs that pull the latest Salesforce data into CRM Analytics for use by the dataflow.

The Run Now option from the dropdown list against the SFDC_LOCAL connection.

  1. To monitor the sync jobs, click Monitor and click the Jobs subtab. You should see that the syncs are currently running.
  2. Click the Refresh Jobs button ( ) until the status of all sync jobs changes from Running to Successful.
  3. When all the sync jobs are complete, click the Dataflows & Recipes option and open the Dataflows tab.
  4. To the right of the "Exec App 1 eltDataflow" dataflow, click the dropdown and select Run Now. This dataflow populates the datasets with data required by the Exec Only dashboards.
  5. To monitor the dataflow, click Monitor and click the Dataflows tab. You should see that the dataflow is running.
  6. Click the Refresh Jobs button until the dataflow's status changes from Running to Successful. (If you see a warning message, ignore it and keep going. It doesn’t hurt your app’s data.)

Resources

Condividi il tuo feedback su Trailhead dalla Guida di Salesforce.

Conoscere la tua esperienza su Trailhead è importante per noi. Ora puoi accedere al modulo per l'invio di feedback in qualsiasi momento dal sito della Guida di Salesforce.

Scopri di più Continua a condividere il tuo feedback