Add a Remote Connector to a CRM Analytics Template
Using the ConnectorType Variable in variables.json
If your app includes a connection to a remote data source, add the connection to the template using a ConnectorType variable to variables.json. ConnectorType is a variation of the StringType variable with an added connectorType attribute. The attribute lets you specify types of connectors to add to the template dataflow, as follows:
"ExternalConnector" : {
"label" : "my connector",
"description" : "This will be the connector.",
"variableType" : {
"type" : "ConnectorType",
"connectorType" : "SalesforceExternal”
},
"required" : true
}
The connectorType attribute must be a string. It corresponds to values in WaveDataConnectorTypeEnum. The value is a “starts with” instead of an “equals,” so using Salesforce includes any connector beginning with that string, such as SalesforceExternal, SalesforceMarketingCloud, and SalesforceMarketingCloudOAuth2. Leave the connectorType value blank to include all defined connectors in the org. You can also use a ConnectorType variable as the itemType in an ArrayType variable.
After using the ConnectorType variable in variables.json, add the variable to ui.json so a user creating an app can choose connectors in the template wizard. The user’s org must have at least one connector of the specified type already authenticated, but that connector doesn’t need existing replicated objects. The wizard displays all remote connectors that match the connectorType attribute’s criteria, as shown here.

Add a Rule to Replace the connectionName in the Dataflow
Use the ConnectorType variable in a rule to update the dataflow's digest node connectionName at app creation time. Here’s an example rule:
{
"rules" : [
{
"name" : "UpdateConnectors",
"appliesTo" : [ {
"type" : "workflow",
"name" : "*"
}],
"actions" : [
{
"action" : "set",
"description" : "Use connector for digest node",
"path" : "$..workflowDefinition.digest_Account.parameters.connectionName",
"value" : "${Variables.ExternalConnector}"
}]
}]
}
Avoid using ${Variables.ExternalConnector} directly in the template workflow JSON. Every time the template is updated from the source app, this variable token is overwritten and removed.