---
schema_version: "1"
id: 102cdaacbed19d8ad87166926355c134c353122278da9bbef9c12ce536fdf4ee
title: AnalyticSnapshot
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_analyticsnapshot.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_analyticsnapshot.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: c0a82ce0696d7aa2ea0f6a5d815b4c644d02ecdbe2d9a6fd3d2d50fa7bc38728
description: Represents a reporting snapshot. A reporting snapshot lets you report on historical data. Authorized users can save tabular or summary report results to fields on a custom object, then map those fields to corresponding fields on a target object. They can then schedule when to run the report to load the custom object's fields with the report's data. Reporting snapshots enable you to work with report data similarly to how you work with other records in Salesforce.
---
# AnalyticSnapshot

Represents a reporting snapshot. A reporting snapshot lets you report on historical data. Authorized users can save tabular or summary report results to fields on a custom object, then map those fields to corresponding fields on a target object. They can then schedule when to run the report to load the custom object's fields with the report's data. Reporting snapshots enable you to work with report data similarly to how you work with other records in Salesforce.

## 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 .snapshot.

## 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. |
| groupColumn | string | A column that specifies which level to extract data from the source report. It’s only applicable for summary reports. |
| mappings | [AnalyticSnapshotMapping](#AnalyticSnapshotMapping)\[\] | A list of reporting snapshot mappings. For valid values, see [AnalyticSnapshotMapping](#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 is extracted from. |
| targetObject | string | Required. The custom object where data is inserted. |

## AnalyticSnapshotMapping

AnalyticSnapshotMapping defines the mapping for the reporting snapshot. Valid values are:

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d116068e229">Field</th>

              <th class="featureTableHeader  " id="d116068e232">Field Type</th>

              <th class="featureTableHeader  " id="d116068e235">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d116068e229" data-title="Field"><span class="keyword parmname">aggregateType</span></td>

              <td class="entry" headers="d116068e232" data-title="Field Type">
                <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_report.htm#ReportSummaryType">ReportSummaryType</a>[] (enumeration of type string)
              </td>

              <td class="entry" headers="d116068e235" data-title="Description">List that defines if and how each report field is summarized. For
                valid values, see <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_report.htm#ReportSummaryType">ReportSummaryType</a>.</td>

            </tr>

            <tr>
              <td class="entry" headers="d116068e229" data-title="Field"><span class="keyword parmname"><span class="ph" id="sourceField"><a name="sourceField"><!-- --></a>sourceField</span></span></td>

              <td class="entry" headers="d116068e232" data-title="Field Type">string</td>

              <td class="entry" headers="d116068e235" data-title="Description">The sourceField can be one of the following:<ul class="ul bulletList">
                  <li class="li">The field on the sourceReport that you want to map to the
                    targetField in the targetObject</li>

                  <li class="li">A summary of a filed on the sourceReport (for Summary
                    reports only)</li>

                  <li class="li">A field on the reporting snapshot, such as JobName,
                    RunningUser, or ExecutionTime (set through the user
                    interface)</li>

                </ul>
                <p class="p"><strong class="ph b">Note:</strong> The sourceField must correspond to the
                  sourceType you specify.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d116068e229" data-title="Field"><span class="keyword parmname"><span class="ph" id="sourceType"><a name="sourceType"><!-- --></a>sourceType</span></span></td>

              <td class="entry" headers="d116068e232" data-title="Field Type">
                <a class="xref" href="#ReportJobSourceTypes">ReportJobSourceTypes</a>[] (<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_objects_intro.htm#enumeration_title">enumeration</a> of type string)
              </td>

              <td class="entry" headers="d116068e235" data-title="Description">List that defines the report format for the reporting snapshot.
                For valid values, see <a class="xref" href="#ReportJobSourceTypes">ReportJobSourceTypes</a>.</td>

            </tr>

            <tr>
              <td class="entry" headers="d116068e229" data-title="Field"><span class="keyword parmname"><span class="ph" id="targetField"><a name="targetField"><!-- --></a>targetField</span></span></td>

              <td class="entry" headers="d116068e232" data-title="Field Type">string</td>

              <td class="entry" headers="d116068e235" data-title="Description">A field on the targetObject into which this particular
                sourceField is inserted.</td>

            </tr>

          </tbody>

        </table>

## 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.

<?xml version="1.0" encoding="UTF-8"?>
<AnalyticSnapshot xmlns="http://soap.sforce.com/2006/04/metadata">
    <description\>my description</description\>
    <groupColumn\>INDUSTRY</groupColumn\>
    <mappings\>
        <aggregateType\>Average</aggregateType\>
        <sourceField\>SALES</sourceField\>
        <sourceType\>summary</sourceType\>
        <targetField\> myObject \_\_c.Name</targetField\>
    </mappings\>
    <mappings\>
        <sourceField\>ExecutionTime</sourceField\>
        <sourceType\>snapshot</sourceType\>
        <targetField\> myObject \_\_c.field3\_\_c</targetField\>
    </mappings\>
    <mappings\>
        <sourceField\>INDUSTRY</sourceField\>
        <sourceType\>tabular</sourceType\>
        <targetField\>testObject\_\_c.Name</targetField\>
    </mappings\>
    <name\>my snapshot</name >
    <runningUser\>user@salesforce.com</runningUser\>
    <sourceReport\>myFolder/mytSummaryReport</sourceReport\>
    <targetObject\>myObject\_\_c</targetObject\>
</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](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm "The deploy() and retrieve() calls are used to deploy and retrieve a .zip file. Within the .zip file is a project manifest (package.xml) that lists what to retrieve or deploy, and one or more XML components that are organized into folders.").

#### See Also

- [Report](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_report.htm "Represents a custom report. This metadata type only supports custom reports; standard reports aren’t supported.")