Customizing QuickSight Templates: Using AWS CLI or Boto3 to Create Templates with Specific Sheets

I have a QuickSight analysis with four sheets, and my goal is to create a QuickSight template using only two sheets. Is it possible to accomplish this using AWS CLI or Boto3? Please provide guidance.

Hi @sandeep3
yes should be possible.

you can get the definition of the analyis via

within the defition you can delete the two sheets you dont want (not sure if “hide” is possible).
That definition you should use to create the template.

Hope that will work.
Maybe there is a better option. You could also just create the analysis with just the two sheets and use that to generate the template.

BR

Thank you Eric We are working on both Solutions provided by you and Shravya if we have any queries we will get back to you

Hello @ErikG i have DescribeAnalysisDefinition

aws quicksight describe-analysis-definition --aws-account-id xxx–analysis-id 5ef228dc-5677-4e76-9000-xxxxx–output json > analysis-defination.json

and using this analysis-defination.json i created a template with removing some sheets but I’m facing error

aws quicksight create-template --aws-account-id xxxxx–template-id test-4 --cli-input-json “file://Analysis_def.json”

An error occurred (InvalidParameterValueException) when calling the CreateTemplate operation: The DataSetIdentifier Web and Social Media Analytics used is invalid

is there any way to achieve it? Can you help me

Hi @ErikG can you please help me on this

HI @sandeep3
it looks like you have to check first the “DataSetIdentifier” if its correct and existing.
BR

Hi @ErikG

I’m still encountering an error. I attempted to create a dashboard from the analysis by removing two sheets, but encountered the following errors:

  1. When executing the command:
    aws quicksight create-dashboard --aws-account-id xxxxxx --dashboard-id test-1 --cli-input-json “file://Analysis_Defination_CP.json”
    I received the following error:

An error occurred (InvalidParameterValueException) when calling the CreateDashboard operation: Cannot have more than 200 CalculatedFields bound to DataSet Identifier New custom SQL, found 279.

  1. After reducing the calculated fields to 200, the dashboard creation is still in progress.

Following the execution of the command:

aws quicksight create-dashboard --aws-account-id xxxxx --dashboard-id test-1 --cli-input-json “file://Analysis_Defination_CP.json”

Output:

{
“Status”: 202,
“Arn”: “arn:aws:quicksight:us-east-1:xxxxxx :dashboard/test-1”,
“VersionArn”: “arn:aws:quicksight:us-east-1:xxxxxxx :dashboard/test-1/version/1”,
“DashboardId”: “test-1”,
“CreationStatus”: “CREATION_IN_PROGRESS”,
“RequestId”: “9ccea26a-4202-41b6-9d97-xxxxxxx”
}

Upon describing the dashboard using the below command:

aws quicksight describe-dashboard --aws-account-id xxxxxxxx–dashboard-id test-1

Output:

{
“Status”: 200,
“Dashboard”: {
“DashboardId”: “test-1”,
“Arn”: “arn:aws:quicksight:us-east-1:xxxxxxxx:dashboard/test-1”,
“Name”: “Test Dashboard”,
“Version”: {
“CreatedTime”: “2024-01-22T11:07:30.284000+00:00”,
“Errors”: [
{
“Type”: “INVALID_CALCULATED_COLUMN_EXPRESSION”,
“Message”: “Calculated field xxby xx with error code CONTEXTUAL_UNKNOWN_SYMBOL during validation”,
“ViolatedEntities”: [
{
“Path”: “calculated-field/xx xxxxx”
}
]
}
],
“VersionNumber”: 1,
“Status”: “CREATION_FAILED”,
“DataSetArns”: ,
“Sheets”:
},
“CreatedTime”: “2024-01-22T11:07:29.468000+00:00”,
“LastPublishedTime”: “2024-01-22T11:07:29.468000+00:00”,
“LastUpdatedTime”: “2024-01-22T11:07:30.284000+00:00”
},
“RequestId”: “6e2e623d-daee-489a-8d21-xxx”
}

**

But that calculated field is correct i have checked multiple times

Despite multiple attempts, the issues persist.

Additionally, while attempting to create a template using an existing template by removing sheets using this command :

aws quicksight create-template --aws-account-id xxxxxx --template-id test-1 --cli-input-json “file://Template-testion.json”

An error occurred (InvalidParameterValueException) when calling the CreateTemplate operation: The DataSetIdentifier New custom SQL used is invalid

The encountered error remains consistent as before.

Hi @sandeep3
sorry for the late response.
Could you slove the issues?

Regarding the last error. Did you check the “DataSetIdentifier”?

BR

Hello @sandeep3 !

Were you able to solve this or was @ErikG 's suggestion above helpful in solving this problem? If so could you share your solution or make the comment above as the solution to help the community?

It has been some time since we have heard from you but would still like to help you find a solution. If we do not hear from you in the next 3 business days this topic will be archived.