Passing Parameters with Spaces

Hello QS community,

My team is using Quick Sight 1 click embedding (unable to use api embedding at the moment) and we are running into issues passing a parameter with a space.

Using the qs embedding javascript sdk we were able to pass in parameter values that included a space and they would render correctly on the dashboard.

          parameters: [
            {
              Name: 'userGroup',
              Values: userGroups,
            },

Since we are not able to use the api embedding at the moment, we replicated that with 1 click embedding and appended the parameters onto the embedding url and then embed that entire url with parameters in an iFrame. The parameter values with a space are coming across as “test%20value” and not selected the right values in the dropdowns. I will post a picture of what we are seeing.

Is there a way to render this correctly?

        const iframe = document.getElementById('qsContainer');
        const fragment = userGroups.reduce((url, ug) => {
          url.append('p.userGroup', encodeURIComponent(ug));
          return url;
        }, new URLSearchParams());
        iframe.setAttribute('src', `${1clickURL}#${fragment.toString()}`);

Thanks,

Hello @seanwh,

Welcome to the Quick Sight Community!

Based on the documentation, this should work.

Can you please post here what is the exact URL your code is generating?

Thank you!

Hi Andres.

Here is the link the code is generating. I edited out the account id and changed the directory alias

https://fips-us-gov-west-1.quicksight.amazonaws-us-gov.com/sn/embed/share/accounts/xxxxx/dashboards/test-dashboard?directory_alias=sean-dev#p.userGroup=Analytics%2520Demo%2520VA

Thanks,

Shouldn’t it be https://fips-us-gov-west-1.quicksight.amazonaws-us-gov.com/sn/embed/share/accounts/xxxxx/dashboards/test-dashboard?directory_alias=sean-dev#p.userGroup=Analytics%20Demo%20VA

Oh good catch. I did not notice the 25 there in front of the 20. That fixes the matter. I will try to figure out where that is coming from.

Thanks!