Set parameter value programatically while generating QuickSight embedded report URL
I am working on the QuickSight embedded report url generation. I am trying to set the parameter default value programatically using below JAVA code.It is not working.
GetDashboardEmbedUrlRequest req = new GetDashboardEmbedUrlRequest()
.withAwsAccountId(awsAccountId)
.withDashboardId(reportInput.getDashboadId())
.withUserArn(userArn)
.withIdentityType(EmbeddingIdentityType.QUICKSIGHT)
.withSessionLifetimeInMinutes(sessionTimeout);
req.putCustomQueryParameter("CampaignName", "ABC");
req.putCustomQueryParameter("reportDev", "Program");
// get the dashboard URL
String embedUrl = quickSightClient.getDashboardEmbedUrl(req).getEmbedUrl();
LOGGER.info("URL:{}",embedUrl);
In the above code, "CampaingName" is multivalues parameter attached to the dropdown control. It's default value is set to "[All]" while building a report. Parameter "reportDev" is single value parameter with no default value and no control or any thing attached to it. Dummy parameter I introduced for testing.
After running the code, when I copy the url printed in console by logger and run it in the browser, report opens properly but with "CampaignName" and "reportDev" both set as "ALL".
Sample generated ulr is as below
https://xx-xxxx-x.quicksight.aws.amazon.com/embed/xxxxxxxxxxxxxxxxx/dashboards/xxxxxxxxxxxxxxxxxxx?code=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&identityprovider=quicksight&isauthcode=true
Well if I get the dashboard url and pass the parameter in the url to, it worked properly. "CampaignName" is set to "ABC" and "reportDev" set to "Program". According the data in the report also got filtered. Url working corrctly as below.
https://xx-xxxx-1.quicksight.aws.amazon.com/embed/xxxxxxxxxxxx/dashboards/xxxxxxxxxxxxxxx#p.reportEnv=Program&p.CampaignName=ABC
Can anybody please tell me what is missing in my code. I tried below variation as well but no luck.
req.putCustomQueryParameter("p.CampaignName", "ABC");
req.putCustomQueryParameter("p.reportDev", "Program");
These are custom query parameters that are used in the HTTP request to the AWS service. See putCustomQueryParameter .
Are you using the Javascript SDK for the embedding? If so, you can set/get *Dashboard *parameters
Yes, It is working. But I was looking for server side solution. AWS should have such facility to programtically set values which cannot be tampered at client end.
I'm also looking for a way to prevent client side tampering with parameters, I want to be able to embed a dashboard and only show data that a client is allowed to access but controlled by our platform
Relevant questions
Set parameter value programatically while generating QuickSight embedded report URL
Accepted Answerasked 4 months agoError saving: Cannot modify a default parameter group.
asked 5 years agoCan I specify GET URL path parameter in step function?
asked 4 months agoReplacing quicksight logo - Quicksight
asked 4 months agoIncrease Quicksight Parameter limits
asked 6 months agoMultitenacy in quicksight embedded dashboard without session capacity pricing
asked 3 months agoError saving: Wrong parameter value '"mysql' for parameter replicate-ignore-dbDatabase names in filter value shouldn't exceed 64 symbols
asked a month agoTrying to display Quicksight dashboard on Webpage
asked 2 months agoHow can I update a stack parameter which was set by an SSM parameter?
asked 2 years agoWhat is the correct way to structure a ifelse to be able to filter using a parameter?
asked 3 months ago
from the url linked in the answer an example would be:
req.setParameters({CampaignName: "ABC", reportDev: "Program"});