GoodData portal supports several types of drilling:
- You can configure reports so that when you click them, the reports drill to other reports, dashboards, or attributes. (For more information, see Drilling into Reports.)
- In the embedded mode, you can set a drill event and integrate GoodData with a parent application. You can then drill from reports and insights directly to records outside of GoodData.
This article describes drill events and how they work on embedded KPI dashboards and in Analytical Designer.
For information about drill events for reports, see Embedded Dashboard and Report API - Events and Methods and Handle Drilling Report Requests through Your Web Application.
On embedded KPI dashboards and Analytical Designer, you can use postMessages to send a list of all measures and attributes that you want to be drillable for each insight, i.e. that you want to interact with you application.
Drillable items are then highlighted and clickable. You can then capture the events these measures and attributes fire and use them outside of the GoodData portal.
- In your application, embed a KPI dashboard or Analytical Designer.
For more information, see Embed a KPI Dashboard and Embed Analytical Designer.
Add an event listener to the main windows object in your application and register the following:
When the KPI dashboard or Analytical Designer loads, it sends a
listeningForDrillableItemspostMessage to your application.
Your application sends back the list of URIs and/or identifiers of all measures and attribute display forms that should be drillable.
The list must have the following format:
You can use both display form URIs and identifiers.
If a URI or an identifier from the list cannot be found on the dashboard or is invalid, this item is ignored.
If a measure/attribute from the list does not become drillable, verify that their URI/identifier is correct.
See also the How to Display Measure and Attribute URIs and Identifiers section.
- To customize actions that happen when users click on a drillable item, follow instructions in the Capturing Events Sent from GoodData section.
See Drill Eventing versus Drill into Dashboard for additional details.
How to Display Measure and Attribute URIs and Identifiers
You can display the URI or identifier of each measure or attribute on the GoodData portal grey pages:
- In your browser, go to:
- Click the measure/attribute whose identifier/URI you want to display.
- In the displayForms section, copy the display form identifier/URI.
Capturing Events Sent from GoodData
When a user clicks on a KPI/insight that is listed as a drillable item, a postMessage is sent to your application containing the following information:
executionContextidentifies the KPI/insight and is the same wherever in the KPI/insight users click.
drillContextidentifies the exact place where users click in an insight. It includes information about chart type, values, and so on.
drillToidentifies the KPI's Drill into dashboard settings.
For more information, see Drill Eventing versus Drill into Dashboard below.
To display the
- Add an event listener to your application.
See step 2 in section Enabling Drilling.
- Open the browser developer tools.
- Click on an insight.
In the event listener in the MessageEvent section, search for the captured event
drillTo details in
Drill Eventing versus Drill into Dashboard
Insights on KPI dashboards may include the Set up a KPI Dashboard).option (see
By default, if your embed a KPI dashboard that includes insights with the Drill into dashboard set, the list of drillable items you send is ignored for these particular insights.
To override the Drill into dashboard and use your drilling settings, you must set the
preventDefault URL parameter to true:
The table below shows how the
preventDefault parameter affects the behavior when Drill into dashboard and/or drill eventing are enabled for an insight:
|Insight with drill into dashboard||Insight with drill eventing||What is used|
|✅||❌||Drill into dashboard|
|✅||✅||Drill into dashboard|
preventDefault=true parameter does not delete the Drill into dashboard settings. You can find the settings in
drillTo details contained in the postMessage sent to your application.
For details see Capturing Events Sent from GoodData.
Sample HTML Page
To see an example HTML page with drill eventing implementation, read Sample HTML for Drill Eventing.
Embedded KPI Dashboards with Navigation Panel Displayed
If you embed KPI dashboards, you can use the
showNavigation=true to display the navigation panel with KPI dashboards. (For details, see Embed a KPI Dashboard.)
When you switch to another KPI dashboard, the list of drillable items is lost. Your application must send a new list with drillable items after receiving the
listeningForDrillableItems postMessage from GoodData.