getStories

Retrieves a collection of Einstein Discovery stories.

Syntax 

1import { LightningElement, wire } from "lwc";
2import { getStories } from "lightning/analyticsSmartDataDiscoveryApi";
3
4export default class GetStories extends LightningElement {
5  @wire(getStories, {
6    sourceType: ["AnalyticsDataset"],
7  })
8  onGetStories({ data, error }) {
9    if (error) {
10      console.log("getStories ERROR:", error);
11    } else if (data) {
12      console.log("getStories RESPONSE:", data.stories);
13    }
14  }
15}

Einstein Discovery API Resource 

1GET /smartdatadiscovery/stories

getStories uses this Einstein Discovery API resource.

Parameters 

These parameters are optional.

Parameter NameTypeDescription
folderIdStringFilters the collection to only contain stories for the specified CRM Analytics folder. The ID can be the requesting user’s ID for stories in the user’s private folder.
inputIdStringFilters the collection to only contain stories for the specified story input ID.
pageStringGenerated token that indicates the view of stories to be returned.
pageSizeNumberNumber of items to be returned in a single page. Minimum is 1, maximum is 200, and the default is 25.
qStringSearch terms. Individual terms are separated by spaces. A wildcard is automatically appended to the last token in the query string. If the user’s search query contains quotation marks or wildcards, those symbols are automatically removed from the query string in the URL along with any other special characters.
scopeStringScope type to apply to the collection results.
  • CreatedByMe
  • SharedWithMe
sourceTypeStringSingle source type to apply to the collection results.
  • AnalyticsDataset
  • LiveDataset
  • Report
sourceTypesString[]List of source type to apply to the collection results.
  • AnalyticsDataset
  • LiveDataset
  • Report

Returns 

See Also