Communication with Embedded KPI Dashboards
When you embed Dashboards (see Embed a Dashboard), you can set up receiving messages from the dashboard to your application.
In GoodData, terms workspace and project denote the same entity. For example, project ID is exactly the same as workspace ID.
Supported events and commands
Commands are incoming messages sent from your application to the embedded Dashboard to apply actions.
Events are outgoing messages that the embedded Dashboards send to your application to notify you about the status of commands (for example, success or failure). Events are sent automatically.
ContextId is used to correlate events and commands. It identifies the input and output of the communication.
Events
Event | Event trigger |
---|---|
loadingStarted | The embedded content starts loading.
|
loaded | The content is fully loaded, and the user has permissions to access the dashboard.
|
noPermissions | The user does not have permissions to view or edit the content. The 'data' section contains information about whether view or edit permissions are missing. Possible reason values:
|
resized | An operation increasing the height of the hosting iframe is performed. The 'data' section contains information what height the iframe needs (in pixels).
|
dashboardCreated | A dashboard has been created and saved. The 'data' section contains, among other information, the dashboard ID. You can store it on your side and use later for managing multiple dashboards for this particular user.
|
dashboardCreationCanceled | The user cancels the creation of the dashboard.
|
dashboardUpdated | The existing dashboard has been updated. The 'data' section contains, among other information, the dashboard ID. You can store it on your side and use later for managing multiple dashboards for this particular user.
|
dashboardDeleted | The dashboard has been deleted. The 'data' section contains information about the deleted dashboard.
|
platform | The GoodData platform is temporary unavailable. Possible status values:
For the status of 'error', the 'data' section contains additional error details.
|
setFilterContextFinished | A confirmation that the filters that you sent have been applied.
|
setFilterParentsFinished | A confirmation that the filters that you sent have been applied.
|
filterContextChanged | A set of filters has been changed. Includes the new definitions of all filters that have been changed.
|
setFilterParentsFailed | Failed command if you try to connect a child filter to the parent filter.
List of possible errors:
|
drillToUrlStarted | Drilling to a URL address starts. The message contains the ID of the window. You must enable the
|
drillToUrlResolved | Contains the window ID and the target URL that opens in the specified tab/window. You must enable the The The
To include the actual filter values in the postMessage, set the
|
Commands
Command | Command trigger |
---|---|
switchToEdit | Opens the dashboard for editing (in view mode only).
|
cancelEdit | Closes the dashboard (in edit mode only).
|
addWidget | Adds an item to the dashboard (in edit mode only). Example: Add insight
Example: Add a KPI
|
addFilter | Add a filter to the dashboard (in edit mode only).
|
setFilterContext | Applies a set of filters to the embedded dashboard. You can define, one or more filters in the filter definition. When the received filter configuration is applied, the following happens:
Notes:
Example: Attribute filter - using an identifier
Example: Attribute filter - using URI
Example: Negative attribute filter
Example: Attribute filter with all values
Example: Single selection filter
Example: Absolute date filter
Example: Relative date filter You can use the following granularities:
Example: All time date filter
Example: Ranking filter Although the ranking filter is supported by the interface of |
removeFilterContext | Removes filters from the embedded dashboards (in edit mode only).
|
setFilterParents | Applies a hierarchy among attribute filters on a dashboard (in edit mode only).
Example: Remove all parent filters
|
openScheduleEmailDialog | Opens a dialog for scheduling emails for the current dashboard (in view mode only).
|