WaveLens represents a lens in Salesforce Analytics: a visualization asset associated with an Analytics application and referencing the dataset used to create it. It controls the lens's label, application and dataset associations, visualization type, and template origin.
The type extends MetadataWithContent and inherits content and fullName. The user-facing masterLabel is distinct from the component's metadata identity. Likewise, application uses an application's internal name, not its display label.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The inherited metadata identity of the component, separate from its user-facing label. |
masterLabel |
Required. The label shown to users for the lens. |
application |
Required. The internal name of the associated WaveApplication. |
datasets |
A reference to the WaveDataset used to create the lens. Despite the plural element name, the exposed field is a string described as a reference to a dataset. |
visualizationType |
Required. Allowed values are calheatmap, comparisontable, heatmap, hbar, hbarhdot, matrix, parallelcoords, pie, pivottable, scatter, stackhbar, stackvbar, time, valuestable, vbar, and vdot. |
templateAssetSourceName |
Links the lens to the template used to create it. It is null for assets not created from a template. |
Behavior and Constraints
application, masterLabel, and visualizationType are required. An application display label is not a substitute for the internal application name in application.
Although visualizationType is a string, it has a documented set of allowed values. Use their exact spelling and case, not the display names of chart types. Some names are not literal descriptions: pie selects a donut visualization, time selects a time line, and hbarhdot selects a horizontal dot plot.
templateAssetSourceName records template origin separately from the application and dataset associations. It does not replace either reference. A lens not created from a template has a null value for this element.
Deployment and Retrieval
WaveLens components use the .wlens suffix and are stored in the wave folder. The type supports the wildcard * in a package.xml manifest for deployment and retrieval.
When identifying related components, use the internal application name in application and the dataset reference in datasets. These references identify relevant components, but do not by themselves establish a mandatory deployment sequence.
Relationships
A lens has outgoing references to its Analytics application and dataset. An Analytics asset collection can reference the lens through the collection's asset element. These connections support impact analysis; they do not by themselves establish access permissions.
References
-
WaveApplication:application. -
WaveDataset:datasets.
Referenced By
-
WaveAnalyticAssetCollection:asset.
Reported Issues
- A
WaveDashboardretrieval failure can mention a lens record without being resolved by retrievingWaveLensas well. In a 2023 report, the CLI returnedDashboard state conversion failed: nulland referenced a record ID that the author identified as a lens. Adding aWaveLensretrieval did not change the result. The accepted answer recommended updatingsourceApiVersioninsfdx-project.json, authenticating again, and retrying, based on similar scenarios. This is a reported diagnostic lead for that dashboard retrieval failure, not a general requirement for lens retrieval. See the retrieval failure report and accepted answer.
Common Questions
Where are WaveLens metadata files stored?
They are stored in the wave folder with the .wlens suffix. WaveLens supports * in a package.xml manifest.
Does application use the app label or its internal name?
application requires the internal name of the WaveApplication, not its display label.
Is datasets a list of dataset references?
The exposed datasets element is a string described as a reference to the dataset used to create the lens. Its plural name does not make it a list.
Which visualizationType value creates a donut chart?
Use pie. Other potentially unexpected mappings include time for a time line and hbarhdot for a horizontal dot plot.
Does templateAssetSourceName replace the application or dataset reference?
No. It records the template used to create the lens, separately from application and datasets. It is null for assets not created from a template.