awslabs / amazon-quicksight-embedding-sdk

A SDK to help users embed QuickSight dashboards on other pages.
Apache License 2.0
171 stars 40 forks source link

Parameter in Text visual not updated until window resizes #194

Closed nickday closed 3 months ago

nickday commented 9 months ago

I have a parameter introText that I display in a Text visual on a dashboard.

If I set the initial value in contentOptions.parameters it is shown on the dashboard.

I then update the parameter with:

embeddedDashboardExperience.setParameters([
{
        Name: 'introText',
        Values: 'new text'
    }
]);

The dashboard looks like it is going to update (i.e. charts are dimmed) and the PARAMETERS_CHANGED message is correct. However, the Text visual does NOT update. If I do a resize of the browser window, it then re-renders things and the Text visual shows the updated text correctly.

I'm using resizeHeightOnSizeChangedEvent but tried without with no success.

While this is fixed, is there anything I can manually call after setParameters in order to re-render the dashboard?

sonals-amazon commented 9 months ago

Hi, We are not able to reproduce this on our end. The text does update for us with the expected parameter value. Can you try what happens when you set parameter via url on the quicksight website directly like so https://docs.aws.amazon.com/quicksight/latest/user/parameters-in-a-url.html or what happens when you embed the dashboard with parameters already initialized in contentOptions https://github.com/awslabs/amazon-quicksight-embedding-sdk?tab=readme-ov-file#example-1 Does the dashboard load seem slow

nickday commented 9 months ago

Hi @sonals-amazon thanks for your response.

I had already tried embedding the dashboard with the param already initialised in contentOptions - the initial value from contentOptions is displayed, but any further updates via setParameters don't get applied to the text visual.

I have tried the URL method as you suggest... adding #p.introText=123 to the end of the dashboard URL. This sort of works, let me explain...

New browser tab, open https://eu-west-2.quicksight.aws.amazon.com/sn/dashboards/xxx?#p.introText=123 - the text visual shows "123".

Same browser tab, change URL to https://eu-west-2.quicksight.aws.amazon.com/sn/dashboards/xxx?#p.introText=456 - the dashboard visuals fade out while refreshing (same behaviour as when embedding), but the text visual still shows "123" and does not update.

Open a new browser tab, go to https://eu-west-2.quicksight.aws.amazon.com/sn/dashboards/xxx?#p.introText=456 - the text visual shows "456".

So this is similar to the contentOptions/setParameters issue above - it works when instantiating the dashboard, but any further parameter changes beyond that are not picked up after the dashboard has been instantiated? So this may be a QS issue rather than just related to embedding?

kuehnmic commented 3 months ago

Hi @nickday, please reach out to our developer community . We have SA's monitoring for these types of questions that can help you debug.