Filtering data at runtime for QuickSight embedded dashboards and visuals
You can use filter methods in the Amazon QuickSight embedding SDK to leverage the power of QuickSight filters within your software as a service (SaaS) application at runtime. Runtime filters allow business owners to integrate their application with their embedded QuickSight dashboards and visuals. To accomplish this, create customized filter controls in your application and apply filter presets based on data from your application. Then, developers can personalize filter configurations for end users at runtime.
Developers can create, query, update, and remove filters on an embedded dashboard or visual from their application with the QuickSight Embedding SDK. Create QuickSight filter objects in your application with the FilterGroup data model and apply them to embedded dashboards and visuals using the filter methods. For more information about using the QuickSight Embedding SDK, see the amazon-quicksight-embedding-sdk
Prerequisites
Before you can get started, make sure that you are using the QuickSight Embedding SDK version 2.5.0 or higher.
Terminology and concepts
The following terminology can be useful when working with embedded runtime filtering.
-
Filter group – A group of individual filters. Filters that are located within a
FilterGroup
are OR-ed with each other. Filters within a FilterGroup are applied to the same sheets or visuals. -
Filter – A single filter. The filter can be a category, numeric, or datetime filter type. For more information on filters, see Filter.
Setting up
Before you begin, make sure that you have the following assets and information prepared.
-
The sheet ID of the sheet that you want to scope the
FilterGroup
to. This can be obtained with thegetSheets
method in the Embedding SDK. -
The dataset and column identifier of the dataset that you want to filter. This can be obtained through the DescribeDashboardDefinition API operation.
Depending on the column type that you use, there might be restrictions on the types of filters that can be added to an embedded asset. For more information on filter restrictions, see Filter.
-
The visual ID of the visual that you want to scope the
FilterGroup
to, if applicable. This can be obtained by using thegetSheetVisuals
method in the Embedding SDK.In addition to the
getSheetVisuals
method, theFilterGroup
that you add can only be scoped to the currently selected sheet.
To use this feature, you must already have a dashboard or visual embedded into your application through the QuickSight Embedding SDK. For more information about using the QuickSight Embedding SDK, see the amazon-quicksight-embedding-sdk
SDK method interface
Dashboard embedding getter methods
The following table describes different dashboard embedding getter methods that developers can use.
Method | Description |
---|---|
|
Returns all FilterGroups that are currently scoped to the sheet that is supplied in the parameter. |
|
Returns all |
If the sheet that is supplied in the parameter is not the currently selected sheet of the embedded dashboard, the above methods return an error.
Visual embedding getter methods
The following table describes different visual embedding getter methods that developers can use.
Method | Description |
---|---|
|
Returns all |
Setter methods
The following table describes different setter methods that developers can use for dashboard or visual embedding.
Method | Description |
---|---|
|
Adds and applies the supplied FilterGroups to the embedded dashboard or visual. A |
|
Updates the |
|
Removes the supplied FilterGroups from the dashboard and returns a |
The FilterGroup
that is supplied must be scoped to the embedded sheet or visual that is currently selected.