Dynamic Templates

I need to automate dashboards that have varying datasets depending on the scenario being modeled.

I only want to show sheets for the datasets being used.

I know there is a dynamic way to do this but worried about the performance…delay on the additional api calls.

I already know all combinations of datasets and sheets. Can I just create a combination of templates from my base template for a lookup dictionary that selects the template based on available datasets?

I make an api call to dynamoDB for available datasets. Create a new source entity from api call with template arn.

My big question is…if I remove datasets and sheets from base template…will it still work for new dashboards.

Hi
if you remove dataset from the source it will also impact the dashboards as well.

I think creating a dashboard from Template as opposed to from Analysis is supposed to be more flexible and allow this but I need to test and see.

I guess another option is to keep a placeholder and then hide the sheet??

1 Like

Checkout the CreateTemplate and CreateAnalysis pages. You’ll see in CreateAnalysis under AnalysisId it highlights the fact the id you specify will appear as part of the URL for the analysis.

1 Like

My question is not about the dashboard url but the scenario where you have multiple datasets in a visual but the number of datasets is dynamic and can change.

I want to use the same dashboard template but just update the source entity to remove the dashboard sheets with the now missing datasets when this happens.

Actually the best way to make the sheets dynamic is to NOT use the source template but the Definition file. It’s a beast of a json but it allows the flexibility to control which sheets are shown dynamically by available datasets. In the final stages of testing but so far this looks like the best way to do it.

create_dashboard_params = {
‘AwsAccountId’: aws_account_id,
‘DashboardId’: dashboard_id,
‘Name’: dashboard_name,
‘Definition’: dashboard_definition,
‘Permissions’: permissions,
‘VersionDescription’: ‘Custom dashboard with selected datasets and sheets’,
‘DashboardPublishOptions’: {
‘AdHocFilteringOption’: {‘AvailabilityStatus’: ‘ENABLED’},
‘ExportToCSVOption’: {‘AvailabilityStatus’: ‘ENABLED’},
‘SheetControlsOption’: {‘VisibilityState’: ‘EXPANDED’}
}

1 Like