How to detect url navigation in embeded quicksight console

I am able to embed quicksight console to my website using const embeddedConsoleExperience = await this.embeddingContext.embedConsole(this.frameOptions, this.contentOptions);

I am trying to detect the url, when user navigates on different links (dataset, analysis, dashboard) from within the embeded console. Any suggestion on how to accomplish this?

My ultimate goal is to find out the analysis id or dashboard id from the url.

Hi @tuhin24 ,

Can you explain the use-case a bit more ? How are you going to use the analysis id or dashboard id ?

Kind regards,
Koushik

1 Like

@Koushik_Muthanna I embed console url to my website and open the embeded url defaulting user to the analysis page. From here user can publish the analysis and then go to the dashboard page. I need to know the dashboard id the of the dashboard user just created from the analysis to store it in the database. Since user does not see the url when I embed console to my page, I am trying to find an intuitive way to detect the dashboard id programmatically. Please advise.

You can get asset information by author through Manage assets in the QuickSight console

You can get asset information for users using QuickSight API calls
Search Dashboards : SearchDashboards - Amazon QuickSight

Describe Dashboard API call

Here is an example of a dashboard with analysis + dataset details

aws quicksight describe-dashboard --aws-account-id $aXX --dashboard-id f03adc2a-d7eb-4e9c-9de4-ec186b9ad4c6
{
“Status”: 200,
“Dashboard”: {
“DashboardId”: “f03adc2a-d7eb-4e9c-9de4-ec186b9ad4c6”,
“Arn”: “arn:aws:quicksight:eu-central-1:XXXX:dashboard/f03adc2a-d7eb-4e9c-9de4-ec186b9ad4c6”,
“Name”: “Bike Analytics Dashboard”,
“Version”: {
“CreatedTime”: “2023-04-20T15:17:50.321000+02:00”,
“Errors”: ,
“VersionNumber”: 14,
“Status”: “CREATION_SUCCESSFUL”,
“SourceEntityArn”: “arn:aws:quicksight:eu-central-1:XXXX:analysis/e125df10-25c4-43ab-850e-1a6c5bb36935”,
“DataSetArns”: [
“arn:aws:quicksight:eu-central-1:XXXX:dataset/5a45d6fe-1b6d-41bf-ac89-1f021eb07980”
],
“ThemeArn”: “arn:aws:quicksight:eu-central-1:XXXX:theme/c6b15135-5638-44fb-8064-f452f1b48012”,
“Sheets”: [
{
“SheetId”: “f03adc2a-d7eb-4e9c-9de4-ec186b9ad4c6_ff4090d5-616e-4532-aa5e-de09604a4782”,
“Name”: “Sales Dashboard”
},
{
“SheetId”: “f03adc2a-d7eb-4e9c-9de4-ec186b9ad4c6_782440fd-6c85-4f8d-8f92-b20ddb3e7b2f”,
“Name”: “Report”
}
]
},
“CreatedTime”: “2023-04-18T23:15:52.186000+02:00”,
“LastPublishedTime”: “2023-04-18T23:15:52.186000+02:00”,
“LastUpdatedTime”: “2023-04-20T15:17:50.321000+02:00”
},
“RequestId”: “1e582ba9-5394-459c-a786-2e3bcb8006d0”
}

Hi Koushik, My user does not know the dashboard id they just created from the embedded console. I am trying to instruct our user to find their newly created dashboard id, and enter it to a text box so that we can save it in the database. Do you have any advice on how my user can find the dashboard id easily from the embedded console where they do not see the URL. I am looking to see if I can create embedded callback when user publishes a analysis from embedded console to save the dashboard id in database.

Hi @tuhin24 - Welcome to AWS QuickSight community and thanks for posting the question. The dashboard id is created by QS internally and from end user prospective, they should not aware about this. End user can always see the dashboard name and this information can be stored. By saying that, what is the end goal for this requirement. Why you are trying to store the dashboard ids in the dashboard. Please give more details around the requirement.

Regards - Sanjeeb

Hi @Sanjeeb2022 ,

Once the dashboard id is saved in the database by the admin. The dashboard will be shown to the executive from their internal website. We will need to know the dashaboard id for that purpose. Please let me know if you have any additional questions.

So we have two steps:
In step 1: The admin creates the dashboard and gives read access to their Executive account and saves the dashbaord id to the database from a SAAS website.
in Step 2: Executives should be able to see this dashboard from their internal website. For this we need to know the dashboard id.

Hi @tuhin24 - Thanks for the details. In that case you can extract the dashboard id from QuickSight API suggested by @Koushik_Muthanna

Regards - Sanjeeb

Again, I do not have the dashboard id which is one of the parameters I need to pass to that API. QuickSight does not support API that returns only the dashboards that a particular user has access to. Looping through all the dashboards for for an AWS account is not ideal for multi-tenant application.

Please consider adding a button next to the Dashboard name. Clicking on this button should copy the dashboard id to the clipboard.

@tuhin24

Hoping below additional info might help you to resolve the issue.

Now QuickSight assets Create, Update, and Delete (CUD) events are captured in Amazon EventBridge. With EventBridge, we can respond automatically to events in QuickSight such as a new dashboard creation or update. You can write custom lambda function to capture the event and in the payload you will be having Dashboardid along with user details.

Thanks
Vinod

@tuhin24 ,

Once the dashboard id is saved in the database by the admin. The dashboard will be shown to the executive from their internal website. We will need to know the dashaboard id for that purpose. Please let me know if you have any additional questions.
So we have two steps:
In step 1: The admin creates the dashboard and gives read access to their Executive account and saves the dashbaord id to the database from a SAAS website.
in Step 2: Executives should be able to see this dashboard from their internal website. For this we need to know the dashboard id.

Saving the dashboard id is not enough as different executives might have access to different dashboards. How would you know which dashboard an executive should see ?

From your step1 , the admin is creating the dashboard and providing read access to the executives.
Step 2 is where your executives are accessing the dashboard from the web application. Here you would be using generate-embed-url-for-registered-user — AWS CLI 2.15.4 Command Reference .

The user based embedding Workshop Studio has sample lambda code that should give you an idea on fetching dashboard id which you have to pass for an user.

Again, I do not have the dashboard id which is one of the parameters I need to pass to that API. QuickSight does not support API that returns only the dashboards that a particular user has access to. Looping through all the dashboards for for an AWS account is not ideal for multi-tenant application.

The search-dashboards — AWS CLI 2.15.4 Command Reference does provide you details on the dashboards each user can access.