---
schema_version: "1"
id: 2def6322ee0017ad023c0b6a65bf290276e3b82fbd25ab9c5687aa5a29d02e39
title: DiscoveryStory
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_discoverystory.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_discoverystory.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 11a9bbb70c470d20b3332219b0e110f7465ec091b4fcbd48518bc3d54b08171e
description: Represents the metadata associated with a story used in Einstein Discovery.
---
# DiscoveryStory

Represents the metadata associated with a story used in Einstein Discovery.

A story defines the data and analytical settings that Einstein Discovery uses to generate insights and build predictive models. Story settings include the outcome variable, whether to maximize or minimize the outcome variable, the data to analyze in a CRM Analytics dataset, and other preferences. Story settings tell Einstein Discovery how to conduct the analysis and communicate its results. In Package Manager, this type is listed as "Discovery Story".

![Note](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note.png)

#### Note

Write operations for DiscoveryStory objects are generally not supported.

## Declarative Metadata File Suffix and Directory Location

A DiscoveryStory is stored in the discovery folder. DiscoveryStory have two files:

- file with .story suffix contains the story’s actual data
- file named _ModelName_.story-meta.xml suffix contains the story’s metadata

Here is a sample package.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types\>
        <members\>Subscriber\_Changes</members\>
        <name\>DiscoveryStory</name\>
    </types\>
    <version\>55.0</version\>
</Package\>

## Version

DiscoveryStorys are available in API version 54.0 and later.

## Fields

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



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

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

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

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d394449e112" data-title="Field Name"><span class="keyword parmname">application</span></td>

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

              <td class="entry" headers="d394449e118" data-title="Description">Required. The CRM Analytics app the story is associated with.</td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e112" data-title="Field Name"><span class="keyword parmname">autopilot</span></td>

              <td class="entry" headers="d394449e115" data-title="Field Type">DiscoveryStoryAutopilotStatus</td>

              <td class="entry" headers="d394449e118" data-title="Description">Optional. The autopilot status for the story. One of the following strings: <ul class="ul bulletList">
                  <li class="li"><span class="keyword parmname">Enabled</span></li>

                  <li class="li"><span class="keyword parmname">Disabled</span></li>

                </ul>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e112" data-title="Field Name"><span class="keyword parmname">classificationThreshold</span></td>

              <td class="entry" headers="d394449e115" data-title="Field Type">double</td>

              <td class="entry" headers="d394449e118" data-title="Description">Optional. The threshold for classification predictions for the story.</td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e112" data-title="Field Name"><span class="keyword parmname">label</span></td>

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

              <td class="entry" headers="d394449e118" data-title="Description">Required. The story label. If you package a story, this label appears in
                Package Manager.</td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e112" data-title="Field Name"><span class="keyword parmname">outcome</span></td>

              <td class="entry" headers="d394449e115" data-title="Field Type"><a class="xref" href="#DiscoveryStoryOutcome">DiscoveryStoryOutcome</a></td>

              <td class="entry" headers="d394449e118" data-title="Description">Required. The selected outcome of the story.</td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e112" data-title="Field Name"><span class="keyword parmname">sourceContainer</span></td>

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

              <td class="entry" headers="d394449e118" data-title="Description">Required. The source ID for the story.</td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e112" data-title="Field Name"><span class="keyword parmname">sourceType</span></td>

              <td class="entry" headers="d394449e115" data-title="Field Type">DiscoveryStorySourceType</td>

              <td class="entry" headers="d394449e118" data-title="Description">Required. The source type of the story. One of the following strings: <ul class="ul bulletList">
                  <li class="li"><span class="keyword parmname">AnalyticsDataset</span></li>

                  <li class="li"><span class="keyword parmname">LiveDataset</span></li>

                  <li class="li"><span class="keyword parmname">Report</span></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e112" data-title="Field Name"><span class="keyword parmname">validationContainer</span></td>

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

              <td class="entry" headers="d394449e118" data-title="Description">Optional. The validation ID for the story.</td>

            </tr>

          </tbody>

        </table>

## DiscoveryStoryOutcome

Represents the selected outcome of the generated story.

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



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

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

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

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d394449e284" data-title="Field Name"><span class="keyword parmname">failureValue</span></td>

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

              <td class="entry" headers="d394449e290" data-title="Description">Optional. The value if the story failed.</td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e284" data-title="Field Name"><span class="keyword parmname">field</span></td>

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

              <td class="entry" headers="d394449e290" data-title="Description">Required. The field configuration for the story.</td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e284" data-title="Field Name"><span class="keyword parmname">goal</span></td>

              <td class="entry" headers="d394449e287" data-title="Field Type">DiscoveryStoryOutcomeGoal</td>

              <td class="entry" headers="d394449e290" data-title="Description">Required. The story outcome goal. One of the following strings: <ul class="ul bulletList">
                  <li class="li"><span class="keyword parmname">Maximize</span></li>

                  <li class="li"><span class="keyword parmname">Minimize</span></li>

                  <li class="li"><span class="keyword parmname">None</span></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e284" data-title="Field Name"><span class="keyword parmname">label</span></td>

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

              <td class="entry" headers="d394449e290" data-title="Description">Required. The story outcome label.</td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e284" data-title="Field Name"><span class="keyword parmname">successValue</span></td>

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

              <td class="entry" headers="d394449e290" data-title="Description">Optional. The value if the story succeeded.</td>

            </tr>

            <tr>
              <td class="entry" headers="d394449e284" data-title="Field Name"><span class="keyword parmname">type</span></td>

              <td class="entry" headers="d394449e287" data-title="Field Type">DiscoveryStoryOutcomeType</td>

              <td class="entry" headers="d394449e290" data-title="Description">Required. The story outcome type. One of the following strings: <ul class="ul bulletList">
                  <li class="li"><span class="keyword parmname">Categorical</span></li>

                  <li class="li"><span class="keyword parmname">Count</span></li>

                  <li class="li"><span class="keyword parmname">Number</span></li>

                  <li class="li"><span class="keyword parmname">Text</span></li>

                </ul>
              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definitions

Here is a sample DiscoveryStory:

<?xml version="1.0" encoding="UTF-8"?>
<DiscoverStory xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <application\>MyStoryApp</application\>
    <autopilot\>Enabled</autopilot\>
    <classificationThreshold\>0.7383</classificationThreshold\>
    <label\>SubscriberChanges</label\>
    <outcome\>
        <field\>Subscriber</field\>
        <goal\>Minimize</goal\>
        <label\>SubscriberChangeOutcome</label\>
        <successValue\>Success</successValue\>
        <type\>Numerical</type\>
    </outcome\>
    <sourceContainer\>01X00000000xxxx1AB</sourceContainer\>
    <sourceType\>AnalyticsDataset</sourceType\>
</DiscoveryStory\>

## Wildcard Support in the Manifest File

This metadata type supports 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.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).