AnalyticSnapshot defines a reporting snapshot: configuration that saves tabular or summary report results as records on a custom object for historical reporting. It connects a source Report to a target CustomObject through field mappings.
The metadata definition is not the historical data produced by snapshot runs. It identifies the report, destination object, mappings, and running user, but those settings alone do not establish that a run is scheduled.
Key Elements
| Element | What the Element Controls |
|---|---|
name |
Required display name of the reporting snapshot. This is not the component's unique metadata identity. |
sourceReport |
Required reference to the report from which data is extracted. Uses a folder-qualified name, such as myFolder/mySummaryReport. |
targetObject |
Required reference to the custom object receiving the inserted records. |
runningUser |
Username of the user whose role and sharing settings are used to run the snapshot. Supply a username, not a Salesforce user ID. |
groupColumn |
Selects the grouping level from which data is extracted for a summary report. It does not apply to tabular reports. |
mappings |
List of embedded AnalyticSnapshotMapping entries connecting source values to destination fields. These entries are not separate deployable components. |
sourceType |
Within a mapping, determines how to interpret sourceField. Allowed values are tabular, summary, and snapshot. |
sourceField |
Within a mapping, identifies an available report column, a summarized report field, or snapshot-specific information. Its meaning must match sourceType. |
aggregateType |
Within a mapping, identifies whether and how a report field is summarized. The exposed ReportSummaryType values are Average, Maximum, Median, Minimum, None, Noop, Sum, and Unique. |
targetField |
Within a mapping, identifies the destination field receiving the source value. The field must belong to targetObject. |
Behavior and Constraints
The running user affects the captured data. The role and sharing settings of the username in runningUser determine the snapshot's execution context. Different running users or sharing configurations can produce different captured data even when the report and mappings remain unchanged. This matters when comparing results or moving a snapshot between orgs.
Interpret each mapping independently. The three sourceType values distinguish the source of that mapping's value:
-
tabularreferences an available column insourceReport. It does not require the entire report to be tabular. -
summaryreferences a summarized field in a summary report. Read it together withaggregateType, such asSumorAverage, to identify the value being captured. -
snapshotreferences snapshot-specific information, such asJobName,RunningUser, orExecutionTime. These source fields can be selected through the user interface.
A snapshot-specific sourceField is not an ordinary field on the source report. Mapping execution information alongside report values can preserve the context of the resulting historical records.
For a summary report, read groupColumn together with the mappings to understand the level of detail stored in each historical record. The grouping level and the selected summaries both matter; the mapping's sourceType alone does not describe the whole report.
Reporting snapshots can be scheduled to load report data into the target object. A populated sourceReport, mapping list, and runningUser do not by themselves show that a schedule exists.
Deployment and Retrieval
In Metadata API package files, reporting snapshot definitions are stored in the analyticSnapshots directory with the .snapshot extension. The file name matches the snapshot's unique name, not its display name.
List each reporting snapshot explicitly in package.xml. AnalyticSnapshot does not support the * wildcard for manifest members.
The report, target object, and fields are dependencies, not contents of the snapshot definition. Deploying or retrieving the snapshot definition does not transfer the historical records created by its runs. Its embedded AnalyticSnapshotMapping entries travel with the snapshot rather than as separate components.
When moving a definition between orgs, check the folder-qualified sourceReport, the destination object and fields, and the username in runningUser. An unchanged definition can capture different data if the running user's role or sharing context differs.
Changes to the source report's columns, summaries, or grouping can change the meaning or availability of mapped values. Changes to destination fields affect where those values can be inserted. Interpret sourceField according to sourceType rather than treating every value as a custom-field reference.
Relationships
The snapshot references a report and a destination custom object. Its mappings connect individual source values to destination fields; snapshot-specific source values are interpreted differently from report fields.
References
-
CustomField:sourceField,targetField. A source-field reference depends onsourceType; not everysourceFieldvalue identifies a custom field. -
CustomObject:targetObject. -
Report:sourceReport.
Common Questions
Why doesn't a wildcard retrieve my reporting snapshots?
AnalyticSnapshot does not support * in package.xml. List each snapshot's unique metadata name explicitly, rather than using its display name.
Does runningUser contain a username or a user ID?
It contains a username. That user's role and sharing settings are used when the snapshot runs, so changing the user or sharing configuration can change the captured data.
Can a summary report use a tabular mapping?
Yes. A mapping with sourceType set to tabular references an available report column; it does not declare the entire report's format. A summary mapping instead references a summarized field.
Does deploying AnalyticSnapshot move the historical records?
No. The component defines the reporting snapshot configuration. Historical records produced by its runs are data on the target custom object, not part of this metadata definition.
Do sourceReport, mappings, and runningUser prove that a snapshot is scheduled?
No. Those elements define the source, field mappings, and execution context. Check the snapshot's schedule separately to determine whether a run is scheduled.