---
schema_version: "1"
id: d8efd84862b0f4c7a0580d31a00f3497643f8556ec806209ceaf97426b7414ad
title: Use Live Datasets in a CRM Analytics Template
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_wave_templates/guides/concept/bi-templatesdev-use-live-dataset.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-use-live-dataset.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: c84bcad2cb252571440966619b1a551ba08a8071c8cfa248bbea02c58d9e2390
products:
  - Analytics Templates Developer Guide
  - analytics
---

# Use Live Datasets in a CRM Analytics Template

Use live datasets in your CRM Analytics template with the `liveConnection` attribute to bring in live connections to Snowflake source tables. Creating a template from a source app with live datasets generates the dataset information, but there are considerations for successful app creation for your users.

## Live Datasets in template-info.json

Live datasets are generated when a template is created from the source app containing a live connection to Snowflake. Like a standard SFDC dataset, a live dataset contains a `name` attribute and an optional `label` attribute. Live datasets also contain a `liveConnection` attribute with the Snowflake source table information.

```nolang
"datasetFiles": [
    {
        "name": "my_live_data",
        "label": "My Live Dataset",
        "liveConnection": {
            "connectionName": "myuniquelongconnectioname",
            "sourceObjectName": "Account"
        }
    }
]
```

## Live Datasets in Templated Assets

When you create your template from your source app with a live dataset, the template generation tokenizes the live dataset, just as it does for standard SFDC datasets. Here’s an example of a tokenized live dataset in a dashboard template file.

```nolang
"connectionName" : "${App.Connections.myuniquelongconnectioname.Name}",
"datasets" : [
    {
        "name" : "${App.Datasets.my_live_data.Name}"
    }
],
```

## Considerations for Templates with Live Datasets

For a user to create an app from your template, their consumer org must have an existing connection to Snowflake. This Snowflake connection must have a developer name with the exact value that is specified for the `connectionName` of the dataset entry in the template-info.json file. As a template developer, you must document that your template relies on a Snowflake connection with a specific name in order for app creation from the template to succeed. Prompt your users to verify a Snowflake connection on a custom Visualforce page that you can create and use in the configuration wizard.

**note:** If a Snowflake connection developer name doesn’t match the `connectionName` in the consumer org, app creation from the template fails. The app creation notification email notifies the user of the failure.

To clarify that a Snowflake connection is for use in a templated app, it’s recommended that you create a unique, longer `connectionName` value. The previous examples highlight using a unique and long connection name.

When an app instance is created from your template, the connection information is cloned for each instance. When an app instance is deleted, the cloned connection associated with that app is also deleted, as long as no other live datasets are referencing the connection. The original Snowflake connection created to support templated app instances isn’t deleted, in case other app instances are using the connection.

**See Also**

- [Create an App](https://help.salesforce.com/s/articleView?id=sf.bi_explorer_direct_data_snowflake_create_connection.xml)
