Newer Version Available
AnalyticSnapshot
Declarative Metadata File Suffix and Directory Location
Lightning Platform AnalyticSnapshot components are stored in the analyticSnapshots directory of the corresponding package directory. The file name matches the unique name of the reporting snapshot, and the extension is .analyticsnapshot.
Version
Lightning Platform AnalyticSnapshot components are available in API version 16.0 and later.
Fields
| Field | Field Type | Description |
|---|---|---|
| description | string | A description of the reporting snapshot. |
| fullName | string | The reporting snapshot name used for API access. The name can only contain characters, letters, and the underscore (_) character, must start with a letter, and cannot end with an underscore or contain two consecutive underscore characters. This field is inherited from the Metadata component. |
| groupColumn | string | A column that specifies which level to extract data from the source report. It is only applicable for summary reports. |
| mappings | AnalyticSnapshotMapping[] | A list of reporting snapshot mappings. For valid values, see AnalyticSnapshotMapping. |
| name | string | Required. The display name of the reporting snapshot. |
| runningUser | string | The username of the user whose role and sharing settings are used to run the reporting snapshot. |
| sourceReport | string | Required. The report where data will be extracted from. |
| targetObject | string | Required. The custom object where data will be inserted into. |
AnalyticSnapshotMapping
AnalyticSnapshotMapping defines the mapping for the reporting snapshot. Valid values are:
| Field | Field Type | Description |
|---|---|---|
| aggregateType | ReportSummaryType[] (enumeration of type string) | List that defines if and how each report field is summarized. For valid values, see ReportSummaryType. |
| sourceField | string | The sourceField can be one of the following:
Note: The sourceField must correspond to the sourceType you specify. |
| sourceType | ReportJobSourceTypes[] (enumeration of type string) | List that defines the report format for the reporting snapshot. For valid values, see ReportJobSourceTypes. |
| targetField | string | A field on the targetObject into which this particular sourceField will be inserted. |
ReportJobSourceTypes
An enumeration of type string that defines the report format for the reporting snapshot. Valid values are:
| Enumeration Value | Description |
|---|---|
| snapshot | Use this option if the sourceField contains snapshot-specific information such as JobName, RunningUser, or ExecutionTime. |
| summary | Use this option if referencing a summary (Sum, Average, Minimum, Maximum) of a field from the sourceReport. |
| tabular | Use this option if referencing an available column from the sourceReport. |
Declarative Metadata Sample Definition
Here’s a sample XML definition of a reporting snapshot.
1<?xml version="1.0" encoding="UTF-8"?>
2<AnalyticSnapshot xmlns="http://soap.sforce.com/2006/04/metadata">
3 <description>my description</description>
4 <groupColumn>INDUSTRY</groupColumn>
5 <mappings>
6 <aggregateType>Average</aggregateType>
7 <sourceField>SALES</sourceField>
8 <sourceType>summary</sourceType>
9 <targetField> myObject __c.Name</targetField>
10 </mappings>
11 <mappings>
12 <sourceField>ExecutionTime</sourceField>
13 <sourceType>snapshot</sourceType>
14 <targetField> myObject __c.field3__c</targetField>
15 </mappings>
16 <mappings>
17 <sourceField>INDUSTRY</sourceField>
18 <sourceType>tabular</sourceType>
19 <targetField>testObject__c.Name</targetField>
20 </mappings>
21 <name>my snapshot</name >
22 <runningUser>user@salesforce.com</runningUser>
23 <sourceReport>myFolder/mytSummaryReport</sourceReport>
24 <targetObject>myObject__c</targetObject>
25</AnalyticSnapshot>Wildcard Support in the Manifest File
This metadata type doesn’t support the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.