Edit template-info.json

template-info.json describes the template. It references all the information required to create an app from the template.

template-info.json can also contain conditions. For example, a source app can have a dashboard with charts. You can include conditions in the template-info.json file to remove specific charts when the user creates the app. Conditions can include overrides that enable the addition or exclusion of assets and data from the app. The override is defined in variables.json. See Complex variables.json Variable Types.

The template-info.json file has multiple parts.

Template Metadata 

Metadata information for the template includes the name, description, icons, tags, and custom attributes.

1{
2  "label": "Analytics Training Materials",
3  "name": "analyticsEducation",
4  "description": "An example template to generate datasets, dashboards and lenses for the Analytics introduction course.",
5  "assetVersion": 49,
6  "templateType": "app",
7  "icons": {
8     "templateBadge" : {
9         "name" : "learn"
10     },
11     "appBadge" : {
12          "name" : "16.png"
13     },
14     "templatePreviews" : [
15          {
16             "name": "preview_education",
17             "label": "Analytics Training",
18             "description": "Learn about templates to generate Analytics assets."
19          }
20     ]
21  },
22  "tags": [
23     "Learn",
24     "Templates",
25     "Apps"
26  ],
27  "customAttributes": [
28     {
29          "label" : "Features",
30          "values" : [
31              "Prebuilt Apps",
32              "Mobile Ready"
33           ]
34     }
35  ]
36},

label

Contains the user’s name for the app. Analytics Studio displays this text in the app creation wizard, such as in the template picker and template details page.

The Analytics Studio template picker showing display of text from icons, description, and label template-info.JSON file

name

The unique developer ID for the template ID. Changing it generates a new template.

description

Specifies the description of the template. The template picker displays the contents of description, as shown in the previous image.

assetVersion

Specifies the version for the template assets. The version is set at the time of creation, generating a snapshot of the asset JSON files. The version doesn’t update unless indicated when updating a template. For more information, see Update an Existing Template.

templateType

Specifies the type of template:

  • app: a standard app
  • embeddedapp: an embedded app
  • data: a collection of data assets
  • dashboard: a single dashboard

icons

Contains three possible options.

templateBadge

Defines the small icon that appears in the app picker (shown in the previous image) and at the top of the template details window (shown in the next image). Don’t use a file extension with the name attribute, for example "learn", not "learn.png".

appBadge

Defines the icon shown by Analytics Studio for the app after creation. Must be "1.png" through "21.png". Use a file extension with the name attribute, for example "16.png", not "16".

templatePreviews

Defines preview images displayed on the template details window during the app creation process. Supports multiple images. Don’t use a file extension with the name attribute, for example "preview_education", not "preview_education.png".

tags

Specifies tags that are used in template search and that appear on the template details page (shown in the next image).

customAttributes

Specifies information describing the template in the app creation wizard, such as Salesforce objects used or notable features (shown in the next image).

The Analytics Studio template picker showing display of text from icons, description, and label template-info.JSON file

Template Version Information 

The templateVersion is a string validated as “#.#”. The notesFile, when present, must be an HTML file. If releaseInfo is present, users can reconfigure or upgrade an app that’s been created from the template from Analytics Studio.

1"releaseInfo":{
2    "templateVersion": "1.0",
3    "notesFile": "releaseNotes.html"
4},

After creating an app from a template for the first time, users can reconfigure the app based on the existing version of the template. When you update the number in templateVersion, CRM Analytics prompts users who created an app from the template to upgrade the app to the new version. For more information about reconfiguring and upgrading apps from templates, see Reconfigure an Analytics App and Upgrade an Analytics App.

Note

Variables File 

The file that contains all the variables used in the template is variables.json.

1"variableDefinition": "variables.json",

Configuration Wizard File 

The file that defines the wizard the user fills out, answering questions to set variables, is ui.json.

1"uiDefinition": "ui.json",

Org Readiness File 

The file that defines the validations to perform when the wizard loads is org-readiness.json. These validations verify that the org has the necessary data and setup to support creating an app from the template without failing.

1"readinessDefinition" : "org-readiness.json"

Rules Files 

The file or files defining any rules to be applied to the template assets is rules.json.

1"rules" : [ {
2    "type" : "templateToApp",
3    "file" : "template-to-app-rules.json"
4  }, {
5    "type" : "appToTemplate",
6    "file" : "app-to-template-rules.json"
7  }
8],

The templateToApp rules file defines rules that run when a downstream app is created or updated from a template. These rules are the rules you’re most likely to edit.

The appToTemplate rules file defines rules that run when a template is created or updated from a source app. These rules are created by the framework code. You aren’t likely to edit them.

Dashboards and Lenses 

A dashboard or lens entry can contain a condition statement to determine whether the asset is added at app creation time based on a given variable. This condition statement can be an empty list ("[]").

1"dashboards": [
2  {
3    "file": "dashboards/Elections_2012_Dashboard.json",
4    "label": "elections_dashboard",
5    "name": "Elections Dashboard",
6    "condition" : "${Variables.StringValueInclude == 'Yes'}"
7  }
8],
9"lenses":[
10  {
11    "file": "lenses/Election_Breakdown_By_State.json",
12    "name": "Election Breakdown By State"
13  }
14],

External Datasets 

List of files that define external datasets (CSVs) to create. The list can include XMD. Each dataset entry can contain an entry for a conditional statement, allowing for decisions to be made by variables on whether a dataset asset is added at app creation time. This condition statement can be an empty list ("[]").

1"externalFiles":[
2  {
3    "type" : "CSV",
4    "name" : "State_Codes",
5    "file" : "external_files/StateCode.csv",
6    "schema" : "external_files/StateCode_schema.json"
7  },
8  {
9    "type" : "CSV",
10    "name" : "Election_2012",
11    "file" : "external_files/Election_2012.csv",
12    "schema" : "external_files/Election_2012_schema.json", (optional)
13    "userXmd" : "external_files/Election_2012_XMD.json" (optional)
14  }
15],

Datasets 

The SFDC dataset builder creates these datasets. Label is optional.

1"datasetFiles": [
2  {
3    name": "Election_1980",
4    "label": "Election 1980",
5    "userXmd": "dataset_files/Election_1980_XMD.json"
6  },
7  {
8    "name": "Election_2012",
9    "label": "Election 2012"
10  }
11],

User XMD is NOT required. If it’s present, there’s an XMD JSON file in the dataset_files directory. Otherwise, no XMD JSON file is present. If User XMD exists, it must be v2.0.

Each dataflow or recipe file must contain a reference to the corresponding dataset (Extract and Register steps). That enables the dataset to be recreated in the creation process of any downstream app.

Live datasets are supported with the liveConnection parameter. For more information, see Use Live Datasets in a CRM Analytics Template.

Dataflow Files 

List of files that define dataflows. This reference can be an empty list ("[]"). If your app includes multiple dataflows, reference each dataflow file. When a user creates an app from the template, dataflows are created in the order they’re entered here.

1"eltDataflows" : [
2  {
3    "label" : "One DF",
4    "name" : "One_DF",
5    "file" : "dataflow/One_DF.json"
6  },
7  {
8    "label" : "Two DF",
9    "name" : "Two_DF",
10    "file" : "dataflow/Two_DF.json"
11  }
12],

Recipe Files 

List of files that define recipes. This reference can be an empty list ("[]"). If your app includes multiple recipes, reference each recipe file. When a user creates an app from the template, recipes are created in the order they’re entered here. Edit the order as needed. If dataflows exist in the app, they execute before the recipes. For more information, see Add a Recipe to a CRM Analytics Template. You can also specify whether a recipe should sync and execute during app creation with the executeCondition attribute. For more information, see Configure Recipe Execution.

1"recipes" : [
2  {
3    "label" : "Filter States Recipe",
4    "name" : "Filter_States_Recipes",
5    "file" : "recipes/filterRecipe.json"
6  },
7  {
8    "label" : "Append Cities Recipe",
9    "name" : "Append_Cities_Recipe",
10    "file" : "recipes/appendRecipe.json",
11    "executeCondition" : "CreateOnly"
12  }
13],

Dashboard Components 

List of files that define components in dashboards. This reference can be an empty list ("[]"). Each dashboard component in the app’s dashboards gets a unique entry in this list. Each component entry can contain an entry for a conditional statement, allowing for decisions to be made by variables on whether a component asset is added at app creation time. This condition statement can be an empty list ("[]").

1"components" : [
2  {
3    "label" : "ImageComponent",
4    "name" : "ImageComponent_tp",
5    "file" : "components/ImageComponent.json"
6  }
7],

Template Dependencies 

For templates with dependencies, add a line to template-info.json that refers to templates to include in the dependency. See Create Dependent Templates.

Images 

These images are associated with the app and used in dashboard files. Each image can contain an entry for a condition statement. Specifying a condition enables decisions to be made with variables on whether an image is added at app creation time. Images must be stored as static resources. References to each image must specify a namespace attribute if the org uses namespace.

1"imageFiles" : [
2  {
3    "name" : "image1",
4    "condition" : "${Variables.ShowImage1}",
5    "file" : "images/image1.png"
6    "namespace" : "${Org.Namespace}"
7  },
8  {
9    "name" : "image2",
10    "file" : "images/image2.png"
11    "namespace" : "${Org.Namespace}"
12  }
13],

Folder File 

The file that contains the folder information including featuredAssets and shares is folder.json.

1"folderDefinition": "folder.json",

Auto-Install File 

The file that contains the auto-install hook configuration and the installed app configuration is auto-install.json. This file must exist if your template is installed with a managed package and the app is created with an auto-install request.

1"autoInstallDefinition": "auto-install.json",

Smart Wizard Apex Callback 

You can also call a smart wizard from template-info.json to perform computations or detection on the user’s data. The call to the smart wizard must be backed up with an Apex callback class. The Apex callback class can run the smart wizard before or after the configuration wizard runs and when the creation of the app is kicked off. You call the Apex class from template-info.json with something like this:

1"apexCallback": {
2  "namespace": "${Org.Namespace}",
3  "name": "GenericConfigurationModifier"
4},

For more about the smart wizard, refer to the Best Practices section.

See Also