Dan Cook
Dan Cook

Reputation: 2072

Embedded QuickSight dashboard with URL Action to another dashboard

Scenario:

I have a QuickSight dashboard embedded into the web application which is appearing correctly.

This dashboard (Dashboard A) contains a URL action which links to a seperate dashboard (Dashboard B).

I used Chrome Tools to grab the embed URL for dashboard B and configured it as the URL Action in the Analysis:

https://eu-west-1.quicksight.aws.amazon.com/embed/yyyyyyyyyyyYYYYYYYYYYYyyyy/dashboards/xxxxxxx-xxxx-xxxx-xxxxxxxxxx

Now when the URL Action is clicked on the embedded Dashboard A, it correctly links to Dashboard B.

However if another user accesses the same embedded Dashboard A and clics the link, it results in

We can't display this page (Not authorized).

It seems like the first parameter yyyyyyyyyyyYYYYYYYYYYYyyyy is user specific, so the URL Action for Dashboard B cannot be hardcoded like this.

What is the correct approach for linking between embedded QuickSight dashboards. Is URL Actions the way to go, or is an alternative approach required?

Solution

The "embed token" (yyyyyyyyyyyYYYYYYYYYYYyyyy) for the URL Action must be passed from the client side embed script as a parameter. The value to be passed can be retreived by parsing the session URL from Dashboard A.

    const embed = () => {
        const options = {
            url: props.sessionUrl,
            ...
            parameters: {
                embedToken: props.sessionUrl.split('/')[4]
            },
            ...
        };
        QuickSightEmbedding.embedDashboard(options);
    };

Then in QuickSight the parameter can be used to form the URL for the URL Action as follows. (Make sure to add embedToken as a string as parameter in the Quicksight analysis).

https://eu-west-1.quicksight.aws.amazon.com/embed/<<$embedToken>>/dashboards/xxxxxxx-xxxx-xxxx-xxxxxxxxxx

Embedded Dashboard A then correctly links to embedded Dashboard B when viewed by any user.

Upvotes: 1

Views: 2451

Answers (1)

Bastien R
Bastien R

Reputation: 76

One alternative could be to generate the embed URL for dashboards A and B separately in your web application and pass the embed URL of Dashboard B as an external parameter for Dashboard A. Since you can use parameters inside an action URL, it should work.

Upvotes: 2

Related Questions