Class: AnalyticsDashboard
A web component for embedding a Tableau Next dashboard.
AnalyticsComponent
new AnalyticsDashboard(
props):AnalyticsDashboard
The constructor for AnalyticsDashboard.
• props: DashboardProps
The initialization properties for the dashboard component.
In multi-org scenarios, always specify the orgUrl parameter when creating components:
The orgUrl parameter must be a Lightning URL (e.g., https://yourorg.lightning.force.com), not the my.salesforce.com domain URL.
AnalyticsComponent.constructor
parentIdOrElement:
string|HTMLElement
This ID of the container or the container where the analytics component is embedded.
AnalyticsComponent.parentIdOrElement
getcomponentType():string
Returns the component type: 'dashboard'.
string
AnalyticsComponent.componentType
getfilters():UnifiedFilterJson[]
The filters for the component.
setfilters(val):void
• val: UnifiedFilterJson[]
- Returns a list of filters for the component.
AnalyticsComponent.filters
getheight():string
The height for the component, in CSS units. Acceptable string formats include:
- Pixel values (e.g., "800px")
- Percentages (e.g., "100%")
- Relative units (e.g., "2rem", "1.5em")
- Other valid CSS height values.
If an invalid value is provided, the value defaults to 100%.
setheight(val):void
• val: string
string
- Returns the height of the component.
AnalyticsComponent.height
gethideHeader():boolean
Indicates whether the header is currently hidden.
Default is false, meaning the header is visible.
boolean
true if the header is hidden, false otherwise.
getidOrApiName():string
The ID or API name used to identify the Tableau Next component.
setidOrApiName(val):void
• val: string
string
- Returns the ID or API name of the component to embed.
AnalyticsComponent.idOrApiName
getorgUrl():undefined|string
The org URL for the component.
In multi-org scenarios, this property identifies which org the component belongs to. Returns a Lightning URL (e.g., https://yourorg.lightning.force.com).
setorgUrl(val):void
• val: string
undefined | string
The org URL, or undefined if not set.
AnalyticsComponent.orgUrl
getpageName():string
Gets the name of the current dashboard page. Use this when you need to reference or display the active page.
string
The name of the current page.
getwidth():string
The width for the component, in CSS units. Acceptable string formats include:
- Pixel values (e.g., "800px")
- Percentages (e.g., "100%")
- Relative units (e.g., "2rem", "1.5em")
- Other valid CSS width values.
If an invalid value is provided, the value defaults to 100%.
setwidth(val):void
• val: string
string
- Returns the width of the component.
AnalyticsComponent.width
applyFilters(
filters):Promise<void>
Apply the specified filters to the component.
If the filter format is invalid, an ERROR event is thrown and the filter application fails.
Please ensure that all filters are correctly formatted and have correct values for the required properties.
• filters: UnifiedFilterJson[]
A list of filters.
Promise<void>
- A promise that resolves when the filters are applied.
AnalyticsComponent.applyFilters
clearFilters():
Promise<void>
Clears the current list of filters for the component.
Promise<void>
A promise that resolves when the fliters are removed.
AnalyticsComponent.clearFilters
export(
filename?,filetype?):Promise<void>
Triggers an event requesting an export of the component in the required format.
• filename?: string
The name of the file to export, excluding the file extension. If not provided, the componentName is used.
• filetype?: ExportFileType = ExportFileType.PNG
The format of export. If not provided, defaults to PNG. Supported types: PNG.
Promise<void>
A promise that resolves when the export operation is complete.
Throws an error if the export operation isn't supported.
AnalyticsComponent.export
getDataSources():
Promise<DataSource[]>
Returns a list of data sources available for the embedded dashboard. Use this function when applying filters to dashboards, which can have multiple data sources.
Promise<DataSource[]>
A promise that resolves to a list of data sources.
Raises error event for timeouts, permissions, or other issues
getFields(
dataSources?):Promise<Map<string,Field[]>>
Returns a map of fields associated with the component.
• dataSources?: DataSource[]
A list of data sources to retrieve the fields from. This isn't required for visualizations and metrics. If omitted for dashboards, fields for all available data sources are returned.
Promise<Map<string, Field[]>>
- A promise that resolves to a map where each key is a string data source API name
and value is an array of Field objects.
AnalyticsComponent.getFields
getFilterFieldValues(
fieldApiName,fieldObjectName?,searchTerm?):Promise<any>
Retrieves the values for a specified field.
• fieldApiName: string
Required. The API name of the field to retrieve the values for.
• fieldObjectName?: string
The object name of the field.
The fieldObjectName parameter is only required if the specified field has an associated object name.
User can know whether field has an associated object name or not in the response of getFields().
• searchTerm?: string
Optional. A search term to filter the field values.
Promise<any>
A promise that resolves with the field values. The exact structure depends on the event handler.
AnalyticsComponent.getFilterFieldValues
getFilters():
Promise<UnifiedFilterJson[]>
Returns the list of filters applied to the component.
Promise<UnifiedFilterJson[]>
A promise that resolves to a list of FilterInfo objects.
AnalyticsComponent.getFilters
getInteractionDetails():
Promise<InteractionDetails>
Returns a comprehensive map containing all available data sources, fields, and filter fields for the component. This method provides a complete overview of the component.
Note: The dataSources array is only available for DashboardComponent
Promise<InteractionDetails>
A promise that resolves to an InteractionDetails object containing:
dataSources: Array of available data sourcesfields: Map where each key is a string data source API name and value is an array ofFieldobjectsfilterFields: Map where each key is a string data source API name and value is an array of filterableFieldobjects
AnalyticsComponent.getInteractionDetails
getMetadata():
Promise<ComponentMetadata>
Returns the component metadata. Use this to get information about the embedded component, such as its name, description, and configuration.
Promise<ComponentMetadata>
A promise that resolves to the ComponentMetadata object.
AnalyticsComponent.getMetadata
getPages():
Promise<string[]>
Returns the list of page labels for the dashboard.
Promise<string[]>
A promise that resolves to a list of page labels.
reload():
Promise<void>
Reloads the component to retrieve the latest data from the server.
Promise<void>
- A promise that resolves when reload is complete.
AnalyticsComponent.reload
render():
Promise<string>
Renders the component by appending it to the specified parent element.
Promise<string>
A promise that resolves when the component is loaded successfully, or rejects with an error message if the loading fails.
AnalyticsComponent.render
setPage(
pageLabel?):Promise<void>
Sets the embedded dashboard to the specified page label. Only one page of the dashboard can be embedded at a time.
• pageLabel?: string
The label of the page to display. If not specified, displays the first page.
Promise<void>
A promise that resolves when the page is set