Bi Dev Guide Sdk
DOWNLOAD
First things first !
To download this implementation guide, click the download button below.
If you need more information about the implementation guide, you can read the Table of Contents below.
Analytics SDK Developer Guide
Salesforce Spring
salesforcedocs
Last updated January
Copyright Salesforce Inc All rights reserved Salesforce is a registered trademark of Salesforce Inc as are other
names and marks Other marks appearing herein may be trademarks of their respective owners
CONTENTS
Analytics SDK Developer Guide Overview
CRM Analytics Lightning Web Components
CRM Analytics Assets SDK Aura Component
CRM Analytics Template SDK Aura Component
CRM Analytics Aura Events
CRM Analytics in Apex
Release Notes
ANALYTICS SDK DEVELOPER GUIDE OVERVIEW
Use the Analytics SDK features to embed CRM Analytics functionality directly where your users work everyday without having to transition
between Lightning Experience and CRM Analytics Studio The Analytics SDK lets you communicate and interact with CRM Analytics
assets from Lightning Apps Lightning Web Components Apex Visualforce and more You can create one cohesive experience powered
by CRM Analytics features directly in Salesforce pages and apps
Important The CRM Analytics SDK and all its components require the purchase of CRM Analytics Platform licenses
CRM Analytics Lightning Web Components
Are you ready to use the power of CRM Analytics directly inside Lightning Experience and create your own custom CRM Analytics
functionality By using theCRM Analytics Lightning Web Components you can access the power of REST APIs to retrieve collections of
CRM Analytics data assets execute queries and schedule data syncs for recipes and dataflows
CRM Analytics Assets SDK Aura Component
Use the CRM Analytics wavesdk Aura Component to retrieve collections of CRM Analytics assets such as dashboards lenses and
datasets and describe the details of individual assets Then customize the display of the results via a Lightning Component controller
You can also create dynamic SAQL queries against your CRM Analytics data to display runtime results
CRM Analytics Templates SDK Aura Component
You have great apps and youre creating app templates to copy or distribute those apps And you might even be using the REST APIs
to work with templates and folders
By using the CRM Analytics wavesdk Aura Component template methods your application can do many of the same things
from a Lightning Component controller
CRM Analytics Aura Events
Would you like your application to communicate with your CRM Analytics dashboards whether your application is built with the Lightning
SDK Visualforce or mobile How about from an application outside of Salesforce Wouldnt it be great if your application could apply
filters or know about dashboard selections and filters made by a user
Your application could take actions specific for your business when values fall outside of defined ranges Or you could have an application
that is a viewpoint for dashboards made available by different parts of your business application ecosystem Imagine that a single
information source to present to your executive staff
The CRM Analytics Aura events are the foundation for a new way of thinking about CRM Analytics applications Coupled with the Lightning
Locker you can even code your application outside of Salesforceyou can interact with CRM Analytics from any JavaScript application
Analytics SDK Developer Guide Overview
CRM Analytics Lightning Web Components
CRM Analytics in Apex
Is your company one of the gazillion using custom code in Apex the serverside programming language for Lightning Platform Would
you like it to be easier to query data in CRM Analytics directly from your Apex code Say hello to the CRM Analytics in Apex features
CRM Analytics in Apex lets developers build wellformed SAQL queries and execute them in the security context of the loggedin user
ensuring that security settings are honored API versioning is supported to avoid breaking applications as the feature set evolves Use
WaveLenses to list and describe CRM Analytics lens assets CRM Analytics also offers WaveInvalidParameterException
to help catch bad values supplied to the class methods
CRM Analytics Lightning Web Components
Use CRM Analytics Lightning Web Components to retrieve data and metadata for CRM Analytics assets execute queries and schedule
data syncs for recipes dataflows and data connectors
CRM Analytics Assets SDK Aura Component
Discover CRM Analytics dashboards lenses and datasets get their details and dig into dataset fields Discover dashboard saved
views and explore dashboard state Create and execute queries directly on datasets
CRM Analytics Template SDK Aura Component
Discover CRM Analytics templates and apps created from them Create update and delete CRM Analytics apps created from templates
CRM Analytics Aura Events
Easily interact with the embedded CRM Analytics Dashboard component in custom applications Use Aura Events for Lightning
Apps Visualforce or your preferred development environment
CRM Analytics in Apex
Build and execute queries and retrieve lens and template data using CRM Analytics Apex classes and methods
CRM Analytics Lightning Web Components
Use CRM Analytics Lightning Web Components to retrieve data and metadata for CRM Analytics assets execute queries and schedule
data syncs for recipes dataflows and data connectors
The lightninganalyticsWaveApi module provides wire adapters and JavaScript functions built on top of the CRM Analytics
REST API Use these wire adapters and functions to work with CRM Analytics data and metadata
Wire Adapters
getActions
Retrieves a collection of Salesforce actions available for the specified Analytics user For more information on syntax and usage see the
getActions reference in the Lightning Web Components Developer Guide
getAnalyticsLimits
Retrieves the Analytics limits for CRM Analytics For more information on syntax and usage see the getAnalyticsLimits reference in the
Lightning Web Components Developer Guide
getDataConnector
Retrieves a specific CRM Analytics data connector by ID or developer name For more information on syntax and usage see the
getDataConnector reference in the Lightning Web Components Developer Guide
getDataConnectors
Analytics SDK Developer Guide Overview
CRM Analytics Lightning Web Components
Retrieves a collection of CRM Analytics data connectors For more information on syntax and usage see the getDataConnectors reference
in the Lightning Web Components Developer Guide
getDataConnectorSourceFields
Retrieves a collection of source fields for a source object used by a CRM Analytics data connector For more information on syntax and
usage see the getDataConnectorSourceFields reference in the Lightning Web Components Developer Guide
getDataConnectorSourceObject
Retrieves a source object used by a CRM Analytics data connector For more information on syntax and usage see the
getDataConnectorSourceObject reference in the Lightning Web Components Developer Guide
getDataConnectorSourceObjectDataPreviewWithFields
Retrieves the fields for a data preview for a source object used by a CRM Analytics data connector For more information on syntax and
usage see the getDataConnectorSourceObjectDataPreviewWithFields reference in the Lightning Web Components Developer Guide
getDataConnectorStatus
Retrieves the status for a specific CRM Analytics data connector by ID or developer name For more information on syntax and usage
see the getDataConnectorStatus reference in the Lightning Web Components Developer Guide
getDataConnectorTypes
Retrieves the collection of CRM Analytics data connector types For more information on syntax and usage see the getDataConnectorTypes
reference in the Lightning Web Components Developer Guide
getDataflowJob
Retrieves a specific CRM Analytics dataflow job For more information on syntax and usage see the getDataflowJob reference in the
Lightning Web Components Developer Guide
getDataflowJobs
Retrieves a collection of CRM Analytics dataflow jobs For more information on syntax and usage see the getDataflowJobs reference in
the Lightning Web Components Developer Guide
getDataflowJobNode
Retrieves a specific CRM Analytics dataflow job node for a recipe or dataflow For more information on syntax and usage see the
getDataflowJobNode reference in the Lightning Web Components Developer Guide
getDataflowJobNodes
Retrieves a collection of CRM Analytics dataflow job nodes for a recipe or dataflow For more information on syntax and usage see the
getDataflowJobNodes reference in the Lightning Web Components Developer Guide
getDataflows
Retrieves a collection of CRM Analytics dataflows For more information on syntax and usage see the getDataflows reference in the
Lightning Web Components Developer Guide
getDataset
Retrieves a specific CRM Analytics dataset by ID or developer name For more information on syntax and usage see the getDataset
reference in the Lightning Web Components Developer Guide
getDatasets
Retrieves a collection of CRM Analytics datasets For more information on syntax and usage see the getDatasets reference in the Lightning
Web Components Developer Guide
getDatasetVersion
Analytics SDK Developer Guide Overview
CRM Analytics Lightning Web Components
Retrieves a specific CRM Analytics dataset version by ID or developer name For more information on syntax and usage see the
getDatasetVersion reference in the Lightning Web Components Developer Guide
getDatasetVersions
Retrieves a collection of versions for a CRM Analytics dataset For more information on syntax and usage see the getDatasetVersions
reference in the Lightning Web Components Developer Guide
getDependencies
Retrieves a collection of dependencies for a CRM Analytics asset For more information on syntax and usage see the getDependencies
reference in the Lightning Web Components Developer Guide
getRecipe
Retrieves a specific CRM Analytics recipe by ID For more information on syntax and usage see the getRecipe reference in the Lightning
Web Components Developer Guide
getRecipes
Retrieves a collection of CRM Analytics recipes For more information on syntax and usage see the getRecipes reference in the Lightning
Web Components Developer Guide
getReplicatedDataset
Retrieves a specific CRM Analytics replicated dataset by ID also known as a connected object For more information on syntax and usage
see the getReplicatedDataset reference in the Lightning Web Components Developer Guide
getReplicatedDatasets
Retrieves a collection of CRM Analytics replicated datasets also known as connected objects For more information on syntax and usage
see the getReplicatedDatasets reference in the Lightning Web Components Developer Guide
getReplicatedFields
Retrieves a collection of fields belonging to a CRM Analytics replicated dataset also known as connected object For more information
on syntax and usage see the getReplicatedFields reference in the Lightning Web Components Developer Guide
getSchedule
Retrieves a schedule for a CRM Analytics recipe dataflow or data sync For more information on syntax and usage see the getSchedule
reference in the Lightning Web Components Developer Guide
getSecurityCoverageDatasetVersion
Retrieves the security coverage for a specific CRM Analytics dataset version by ID or developer name For more information on syntax
and usage see the getSecurityCoverageDatasetVersion reference in the Lightning Web Components Developer Guide
getStories
Retrieves a collection of Einstein Discovery stories For more information on syntax and usage see the getStories reference in the Lightning
Web Components Developer Guide
getWaveFolders
Retrieves a collection of CRM Analytics apps or folders For more information on syntax and usage see the getWaveFolders reference in
the Lightning Web Components Developer Guide
getWaveTemplate
Retrieves a CRM Analytics template by ID or API name For more information on syntax and usage see the getWaveTemplate reference
in the Lightning Web Components Developer Guide
getWaveTemplateConfig
Analytics SDK Developer Guide Overview
CRM Analytics Lightning Web Components
Retrieves the configuration for a CRM Analytics template by ID or API name For more information on syntax and usage see the
getWaveTemplateConfig reference in the Lightning Web Components Developer Guide
getWaveTemplateReleaseNotes
Retrieves the release notes for a CRM Analytics template by ID or API name For more information on syntax and usage see the
getWaveTemplateReleaseNotes reference in the Lightning Web Components Developer Guide
getWaveTemplates
Retrieves a collection of CRM Analytics templates For more information on syntax and usage see the getWaveTemplates reference in
the Lightning Web Components Developer Guide
getXmd
Retrieves a specific CRM Analytics extended metadata type Xmd for a version of a dataset For more information on syntax and usage
see the getXmd reference in the Lightning Web Components Developer Guide
Functions
createDataConnector
Creates an instance of a CRM Analytics connector to connect to data in your Salesforce orgs apps data warehouses and database
services For more information on syntax and usage see the createDataConnector reference in the Lightning Web Components Developer
Guide
createDataflowJob
Creates a CRM Analytics dataflow job which is the equivalent of clicking Run Now for a data prep recipe a data sync or a dataflow in
the CRM Analytics Data Manager UI For more information on syntax and usage see the createDataflowJob reference in the Lightning
Web Components Developer Guide
createDataset
Creates a dataset For more information on syntax and usage see the createDataset reference in the Lightning Web Components
Developer Guide
createDatasetVersion
Creates a version for a specific CRM Analytics dataset by ID or developer name For more information on syntax and usage see the
createDatasetVersion reference in the Lightning Web Components Developer Guide
createReplicatedDataset
Creates a CRM Analytics replicated dataset also known as a connected object For more information on syntax and usage see the
createReplicatedDataset reference in the Lightning Web Components Developer Guide
deleteDataConnector
Deletes a specific CRM Analytics connector by ID or developer name For more information on syntax and usage see the
deleteDataConnector reference in the Lightning Web Components Developer Guide
deleteDataset
Deletes a specific CRM Analytics dataset by ID or developer name For more information on syntax and usage see the deleteDataset
reference in the Lightning Web Components Developer Guide
deleteRecipe
Deletes a specific CRM Analytics recipe by ID For more information on syntax and usage see the deleteRecipe reference in the Lightning
Web Components Developer Guide
deleteReplicatedDataset
Analytics SDK Developer Guide Overview
CRM Analytics Lightning Web Components
Deletes a specific CRM Analytics replicated dataset by ID For more information on syntax and usage see the deleteReplicatedDataset
reference in the Lightning Web Components Developer Guide
executeQuery
Executes a CRM Analytics query written in Salesforce Analytics Query Language SAQL or standard SQL For more information on syntax
and usage see the executeQuery reference in the Lightning Web Components Developer Guide
ingestDataConnector
Triggers the CRM Analytics to run a data sync For more information on syntax and usage see the ingestDataConnector reference in the
Lightning Web Components Developer Guide
updateDataConnector
Updates a CRM Analytics data connector For more information on syntax and usage see the updateDataConnector reference in the
Lightning Web Components Developer Guide
updateDataflowJob
Updates a CRM Analytics dataflow job which is the equivalent of clicking Stop for a data prep recipe a data sync or a dataflow in the
CRM Analytics Data Manager UI For more information on syntax and usage see the updateDataflowJob reference in the Lightning Web
Components Developer Guide
updateDataset
Updates a specific CRM Analytics dataset by ID or developer name For more information on syntax and usage see the updateDataset
reference in the Lightning Web Components Developer Guide
updateDatasetVersion
Updates a specific CRM Analytics dataset version by ID or developer name For more information on syntax and usage see the
updateDatasetVersion reference in the Lightning Web Components Developer Guide
updateRecipe
Updates a CRM Analytics recipe For more information on syntax and usage see the updateRecipe reference in the Lightning Web
Components Developer Guide
updateReplicatedDataset
Updates a CRM Analytics replicated dataset by ID For more information on syntax and usage see the updateReplicatedDataset reference
in the Lightning Web Components Developer Guide
updateReplicatedFields
Updates the collection of fields for a CRM Analytics replicated dataset by ID For more information on syntax and usage see the
updateReplicatedFields reference in the Lightning Web Components Developer Guide
updateSchedule
Updates the schedule for a CRM Analytics data prep recipe data sync or dataflow For more information on syntax and usage see the
updateSchedule reference in the Lightning Web Components Developer Guide
updateXmd
Updates the user Xmd for a CRM Analytics dataset For more information on syntax and usage see the updateXmd reference in the
Lightning Web Components Developer Guide
validateWaveTemplate
Validates a CRM Analytics template for org readiness For more information on syntax and usage see the valildateWaveTemplate reference
in the Lightning Web Components Developer Guide
Analytics SDK Developer Guide Overview
CRM Analytics Assets SDK Aura Component
CRM Analytics Assets SDK Aura Component
Discover CRM Analytics dashboards lenses and datasets get their details and dig into dataset fields Discover dashboard saved views
and explore dashboard state Create and execute queries directly on datasets
Call the SDK
To call the SDK declare the wavesdk component in your component or app
wavesdk auraidsdk
Use sdkinvokeMethod to specify the method and any parameters
sdkinvokeMethodcontext methodName methodParameters callback
For example heres a call that uses listDashboards as methodName
var context
var methodName listDashboards
var methodParameters
pageSize
sort Name
sdkinvokeMethodcontext methodName methodParameters
AgetCallbackfunction err data
if err null
DO THIS IF THE METHOD FAILS
consoleerrorSDK error err
else
DO THIS IF THE METHOD SUCCEEDS
componentsetvdashboards datadashboards
See the wavesdk Component Reference for a full working example
Each method has its own set of parameters methodParameters
Methods and Parameters
listDashboards
Retrieves a list of all dashboards Can be filtered by specifying parameters
Parameter Name
Description
Required
folderId
Filters the results to include only FALSE
the contents of a specific folder
String base platform object ID
format
page
A generated token that indicates FALSE
the view of the dashboards to
be returned
String
Type
Analytics SDK Developer Guide Overview
CRM Analytics Assets SDK Aura Component
Parameter Name
Description
Required
Type
pageSize
Number of items to be returned FALSE
in a single page Default is
and maximum is
Integer
q
Search terms Individual terms
are separated by spaces Wild
cards arent supported
FALSE
String
sort
Sort order of the results Enum FALSE
values are LastModified
MRU and Name Default value
is MRU
String
scope
Type of scope to be applied to
the returned items
CreatedByMe or
SharedWithMe
FALSE
String
type
Asset type
FALSE
String
templateApiName
Filter collection by
FALSE
String
FALSE
String
Required
Type
templateApiName
mobileOnly
For mobile dashboards only
listLenses
Retrieves a list of all lenses Can be filtered by specifying parameters
Parameter Name
Description
folderId
Filters the results to include only FALSE
the contents of a specific folder
String base platform object ID
format
page
A generated token that indicates FALSE
the view of the lenses to be
returned
String
pageSize
Number of items to be returned FALSE
in a single page Default is
and maximum is
Integer
q
Search terms Individual terms
are separated by spaces Wild
cards arent supported
FALSE
String
sort
Sort order of the results Enum FALSE
values are LastModified
MRU and Name Default value
is MRU
String
Analytics SDK Developer Guide Overview
CRM Analytics Assets SDK Aura Component
Parameter Name
Description
Required
Type
scope
Type of scope to be applied to
the returned items
CreatedByMe or
SharedWithMe
FALSE
String
listDatasets
Retrieves a list of all datasets Can be filtered by specifying parameters
Parameter Name
Description
Required
Type
folderId
Filters the results to include only FALSE
the contents of a specific folder
String base platform object ID
format
hasCurrentOnly
Filters the list of datasets to
FALSE
include only those datasets that
have a current version The
default is false
String base platform object ID
format
page
A generated token that indicates FALSE
the view of the dashboards to
be returned
String
pageSize
Number of items to be returned FALSE
in a single page Default is
and maximum is
Integer
q
Search terms Individual terms
are separated by spaces Wild
cards arent supported
FALSE
String
sort
Sort order of the results Enum FALSE
values are LastModified
MRU and Name Default value
is MRU
String
scope
Type of scope to be applied to
the returned items
CreatedByMe or
SharedWithMe
FALSE
String
describeDashboard
Retrieves the details of a single dashboard
Parameter Name
Description
Required
Type
dashboardId
or digit id of the
dashboard
TRUE
String base platform object ID
format
Analytics SDK Developer Guide Overview
CRM Analytics Assets SDK Aura Component
describeLens
Retrieves the details of a single lens
Parameter Name
Description
Required
Type
lensId
or digit id of the lens
TRUE
String base platform object ID
format
describeDataset
Retrieves the details of a single dataset
Parameter Name
Description
Required
Type
datasetId
or digit id of the dataset
TRUE
String base platform object ID
format
getDatasetFields
Retrieves a list of all the fields for a single dataset
Parameter Name
Description
Required
Type
datasetId
or digit id of the dataset
TRUE
String base platform object ID
format
versionId
or digit version id of the
dataset
TRUE
String base platform object ID
format
executeQuery
Executes a CRM Analytics SAQL query
Parameter Name
Description
Required
Type
query
The SAQL query to execute in
JSON format
TRUE
String base platform object ID
format
Required
Type
listDashboardSavedViews
Retrieves a list of all saved views for a dashboard
Parameter Name
Description
dashboardIdOrApiName The or digit id or the fully TRUE
qualified name of the
dashboard
getDashboardSavedView
String base platform object ID
format
Analytics SDK Developer Guide Overview
CRM Analytics Template SDK Aura Component
Retrieves the detail of one dashboard saved view
Parameter Name
Description
Required
dashboardIdOrApiName The or digit id or the fully TRUE
qualified name of the
dashboard
viewId
The or digit id of the saved TRUE
view
Type
String base platform object ID
format
String base platform object ID
format
getDashboardInitialSavedView
Retrieves the initial view information for a dashboard saved view
Parameter Name
Description
Required
dashboardIdOrApiName The or digit id or the fully TRUE
qualified name of the
dashboard
viewId
The or digit id of the initial TRUE
saved view
Type
String base platform object ID
format
String base platform object ID
format
CRM Analytics Template SDK Aura Component
Discover CRM Analytics templates and apps created from them Create update and delete CRM Analytics apps created from templates
Call the SDK
To call the SDK declare the wavesdk component in your component or app
wavesdk auraidsdk
Use sdkinvokeMethod to specify the method and any parameters
sdkinvokeMethodcontext methodName methodParameters callback
For example heres a call that uses listFolders as methodName
var context
var methodName listFolders
var methodParameters
templateSourceId templateSourceId
pageSize pageSize
q q
sort sort
scope scope
page page
isPinned isPinned
mobileOnly false