How to automate updating of Quicksight Dashboard

0

I have a Quicksight Analysis that needs to be published as a Dashboard. The analysis is changing based on demands and I need to update and replace the contents of the existing dashboard. The only way that I know is to click the update and replace existing dashboard through the ui. Is there a way to automate this process?

Edit: Follow up question. Ultimately what I wanted to do is to have the dashboard be refreshed alongside the refresh of the analysis (containing the refreshed dataset) without having to always run commands or click 'publish dashboard' in the ui. I'm looking for a way to trigger and automate that part. Thank you for your answers!

asked a year ago1123 views
2 Answers
0

Hi.

You probably can't do it on the QuickSight console.

Alternatively, embed the dashboard or view into an external website.
The external website uses an iframe to display the QuickSight view.
And on your external site you can write custom code in JavaScript to refresh the iframe every few seconds.

profile picture
EXPERT
iwasa
answered a year ago
  • Thank you for your answer but... Yes, i actually have a website that embeds the quicksight dashboard. However, afaik, it only embeds the Quicksight Dashboard, not the 'Analysis'. And to refresh the data in my embedded dashboard, i need to publish my analysis and replace the existing one so that the same Dashboard ID is pointed to the website. I understand that alternatively, I can run commands on the Quicksight API instead of doing it in the Quicksight console. However, it does not satisfy the automation that I want as it still demands me to run commands whenever a fresh Quicksight Analysis needs to be published as a Dashboard. Do you have an idea how i can automate that part?

  • i was wrong So the analysis settings and configuration are updated, not the dataset. That's difficult.

0

You could achieve this updating analysis template and dashboard by using QuickSight APIs or CLI. Please refer this blog which contain references to some of these commands.

I see it to be a 3-step process

  1. Once you have made the necessary changes to the analysis via UI - update the template
  2. Use the latest template version id and update the dashboard
  3. Publish the dashboard using the latest dashboard id
aws quicksight update-template --cli-input-json file://./template-analysis.json

{
    "Status": 202,
    "TemplateId": "DemoDashboardTemplate",
    "Arn": "arn:aws:quicksight:us-east-1:XXXXXXXXXXXX:template/DemoDashboardTemplate",
    "VersionArn": "arn:aws:quicksight:us-east-1:XXXXXXXXXXXX::template/DemoDashboardTemplate/version/2",
    "CreationStatus": "CREATION_IN_PROGRESS",
    "RequestId": "0ddc99c5-72a2-400b-8222-5a17e78d117e"
}
aws quicksight update-dashboard --cli-input-json file://./update-dashboard.json

{
    "Arn": "arn:aws:quicksight:us-east-1:XXXXXXXXXXXX:dashboard/DemoDashboard1",
    "VersionArn": "arn:aws:quicksight:us-east-1:XXXXXXXXXXXX:dashboard/DemoDashboard1/version/2",
    "DashboardId": "DemoDashboard1",
    "CreationStatus": "CREATION_IN_PROGRESS",
    "Status": 202,
    "RequestId": "46a274c0-a793-45b4-9b44-b54945714c13"
}
aws quicksight update-dashboard-published-version --aws-account-id XXXXXXXXXXXX --dashboard-id DemoDashboard1 --version-number 2

{
    "Status": 200,
    "DashboardId": "DemoDashboard1",
    "DashboardArn": "arn:aws:quicksight:us-east-1:XXXXXXXXXXXX:dashboard/DemoDashboard1",
    "RequestId": "4907a7c1-c86b-4354-9c30-d67d257c45f0"
}
AWS
EXPERT
Gokul
answered a year ago
  • Follow up question. I wanted the dashboard to be refreshed alongside the refresh of the analysis (containing the refreshed dataset) without having to always run commands or click 'publish dashboard' in the ui. i'm looking for a way to trigger and automate that part. Is there a way that i can do that in quicksight? Thank you so much for your answer

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions