Is there a way to pass filter parameters in options for generating embed url

I am using QUICKSIGHT SDK for generating embed URL for embedding dashboard into my web application. I have some filters like Location and DateRange on my dashboard. I want those filters to be pre-applied with some custom values before the URL is generated. Is there a way to do it. I am using the **generate_embed_url_for_registered_user** method

Ex:


    options = {
      aws_account_id: Aws_Account_Id,
      session_lifetime_in_minutes: 300,
      user_arn: "UserArn", 
      experience_configuration: {
                                  dashboard: {
                                    initial_dashboard_id: "DashboardId",
                                  },
      parameters: []  // I have tried passing the filter values here but it is not working
      },

result = Client.generate_embed_url_for_registered_user(options)

embed_url = result['embed_url']

Is there any way I can send the filter values for Location and DateRange in the options itself

Hi @MalharD, you can pass those values using parameters. Just looking at your code snippet I see you’re using square brackets instead of curly brackets {}. You can see an example of how to pass parameters on the developer portal, in the Personalize dashboards for your user section. Go to the “How to customize it” and expand “Enable controls on QuickSight dashboard”. The Pass parameters example will show you the right format.
Also don’t forget they need to be parameters in your dashboard itself. Thanks for your question!

1 Like

Hi @Steph thanks for the help. I tried logging into Developer Portal, but facing some issue. I got the below format while searching online. Could you please confirm if it is correct, as it is still not working on my side. It would be a big help, as I am stuck on this issue for a while.

Is this the correct format to pass the parameters in JS

const options = {
  url: `https://us-east-1.quicksight.aws.amazon.com/embed/${awsAccountId}/dashboard/${dashboardId}`,
  region: region,
  parameters: {
    myParam1: 'myValue1',
    myParam2: 'myValue2'
  },
  sessionLifetimeInMinutes: sessionLifetimeInMinutes,
  userArn: 'your_user_arn',
  identityType: identityType
};

Hi @MalharD, it looks OK. One other thing though, the parameter names are case sensitive, so you need to make sure you’re using exactly the same case as the names you created in QuickSight

1 Like

Hi Steph I’ve the question on the same topic as above. Instead of multiple parameters, like this
myParam1: ‘myValue1’,
myParam2: ‘myValue2’
I’ve the one organization parameter with different values, how can I pass the array of values to a parameter?

const options = {
  url: `https://us-east-1.quicksight.aws.amazon.com/embed/${awsAccountId}/dashboard/${dashboardId}`,
  region: region,
  parameters: {
    organization: 'accounting', 'finance', 'sales'
  },

  userArn: 'your_user_arn',
};