Feature Parameters for Analytics Templates

Feature parameters are available to control behavior in the template-to-app process for CRM Analytics apps. Feature parameters are defined as metadata that is deployed as part of the managed package. When feature parameters are deployed with the template, the parameter values are set using the LMA application.

For more information on feature parameters, see Feature Parameter Metadata Types and Customs Objects in the First-Generation Managed Packaging Developer Guide.

For implementation examples, view and clone the Project Force App in Github.

Analytics Template Metadata

For Analytics templates, the managed package component is WaveTemplateBundle. The template metadata reads feature parameter values set in the LMA application as EL expressions and uses them to control the behavior of app creation. The supported types of feature parameter values are Boolean, Date, and Integer.

Example

Use an Integer Feature Parameter Value in Dashboard Creation

For this example, the feature parameter is deployed using /featureParameters/FinancingAmount.featureParameterInteger-meta.xml.
<FeatureParameterInteger xmlns="http://soap.sforce.com/2006/04/metadata">
   <dataflowDirection>LmoToSubscriber</dataflowDirection>
   <masterLabel>Amount Financed</masterLabel>
   <value>250000</value>
</FeatureParameterInteger>
The feature parameter metadata is referenced in the template-to-app-rules.json file:
{
  "constants":[
    {
      "name": "FinancingAmount", 
      "value": "${sfdc_fma:checkInteger('[namespace__FinancingAmount')}"
    }
  ],
  "rules": [
    {
      "name": "Use Feature Parameter",
      "appliesTo": [
        {
          "type": "dashboard"
        }
      ],
      "actions": [    
        {
          "action": "set",
          "path": "$.state..text_1.parameters.content.displayTemplate",
          "value": "${Constants.FinancingAmount}"
        }
      ]
    }
  ]
}