# How to update-template ? I'm getting "Resource creation can only be done from one SourceEntity or Definition" error

**URL:** <https://community.amazonquick.com/t/how-to-update-template-im-getting-resource-creation-can-only-be-done-from-one-sourceentity-or-definition-error/13412>\
**Category:** Q&A\
**Tags:** quick-sight\
**Created:** [May 13, 2023, 6:38pm UTC](https://community.amazonquick.com/t/how-to-update-template-im-getting-resource-creation-can-only-be-done-from-one-sourceentity-or-definition-error/13412 "2023-05-13T18:38:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbdori](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@tbdori](https://community.amazonquick.com/u/tbdori)\
**Post date:** [May 13, 2023, 6:38pm UTC](https://community.amazonquick.com/t/how-to-update-template-im-getting-resource-creation-can-only-be-done-from-one-sourceentity-or-definition-error/13412/1 "2023-05-13T18:38:18Z")

</div>

When I try to update the template in the command line,

> account\_a\_id=‘xxx’  
> aws quicksight update-template --aws-account-id $account\_a\_id --template-id ‘template\_as\_’ --cli-input-json file://template\_.json

I get the following error :

An error occurred (InvalidParameterValueException) when calling the UpdateTemplate operation: Resource creation can only be done from one SourceEntity or Definition

template\_.json file :

> {  
> “Definition”: {  
> “DataSetConfigurations”: [  
> {  
> “Placeholder”: “xxxx”,  
> “DataSetSchema”: {  
> “ColumnSchemaList”: [,  
> ]  
> },  
> “ColumnGroupSchemaList”:   
> }  
> ],  
> “Sheets”: [  
> {  
> “SheetId”: “xx-4553-x-bf4d-670b10e5fe75”,  
> “Name”: “tab1”  
> },  
> {  
> “SheetId”: “xx-c50f-x-b4f3-1f57914994bd”,  
> “Name”: “tab2”  
> },  
> {  
> “SheetId”: “xx-a0be-x-9121-7e13c279d4ab”,  
> “Name”: “tab3”  
> },  
> {  
> “SheetId”: “xx-4474-x-bda0-c2f3bdacbd61”,  
> “Name”: “tab4”  
> }  
> ]  
> },  
> “SourceEntity”: {  
> “SourceAnalysis”: {  
> “Arn”: “arn:aws:quicksight:us-east-1:xxx:analysis/xxx”,  
> “DataSetReferences”: [  
> {  
> “DataSetPlaceholder”: “xx”,  
> “DataSetArn”: “arn:aws:quicksight:us-east-1:xx:dataset/xxx”  
> }  
> ]  
> }  
> },  
> “VersionDescription”: “1”  
> }

I can’t figure out what the problem is here.

---

<div class="post-metadata">

**Author:** ![Koushik\_Muthanna](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/koushik_muthanna/32/3290_2.png) [@Koushik\_Muthanna](https://community.amazonquick.com/u/Koushik_Muthanna)\
**Post date:** [May 15, 2023, 8:02am UTC](https://community.amazonquick.com/t/how-to-update-template-im-getting-resource-creation-can-only-be-done-from-one-sourceentity-or-definition-error/13412/2 "2023-05-15T08:02:16Z")

</div>

Hi @tbdori ,

**As the error states** “Resource creation can only be done from one SourceEntity or Definition”

If you are updating an existing template, then use the SourceEntity . Remove the Definition.

> {  
> “AwsAccountId”: “”,  
> “TemplateId”: “”,  
> “SourceEntity”: {  
> “SourceAnalysis”: {  
> “Arn”: “”,  
> “DataSetReferences”: [  
> {  
> “DataSetPlaceholder”: “”,  
> “DataSetArn”: “”  
> }  
> ]  
> },  
> “SourceTemplate”: {  
> “Arn”: “”  
> }  
> },  
> “VersionDescription”: “”,  
> “Name”: “”  
> }

Kind regards,  
Koushik

---

<div class="post-metadata">

**Author:** ![tbdori](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@tbdori](https://community.amazonquick.com/u/tbdori)\
**Post date:** [May 16, 2023, 2:41am UTC](https://community.amazonquick.com/t/how-to-update-template-im-getting-resource-creation-can-only-be-done-from-one-sourceentity-or-definition-error/13412/3 "2023-05-16T02:41:03Z")

</div>

@Koushik_Muthanna But, what if I need to remove 2 sheets out of 6 sheets. Then, I need to change Definition \> Sheets section , correct?

Or, is there another way to do such ?

My scenario :  
[DEV account]  
initial development - Analysis 6 sheet, Dashboard 6 sheet  
updated (replace the existing dashboard) - Analysis 6 sheet, Dashboard 4 sheet

[STG account]  
initial migration - Analysis 6 sheet, Dashboard 6 sheet  
updated - ?? how to do ??

* * *

So, I have a dashboard template that has 6 sheets.  
Now, I want to remove 2 sheets so it becomes 4 sheets in STG account

How do I do this?  
I noticed that update-template actually overwrites the existing definition(4 sheets) as soon as I update it with the SourceEntity section. Same for the vice-versa case.

---

<div class="post-metadata">

**Author:** ![Koushik\_Muthanna](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/koushik_muthanna/32/3290_2.png) [@Koushik\_Muthanna](https://community.amazonquick.com/u/Koushik_Muthanna)\
**Post date:** [June 13, 2023, 10:50am UTC](https://community.amazonquick.com/t/how-to-update-template-im-getting-resource-creation-can-only-be-done-from-one-sourceentity-or-definition-error/13412/4 "2023-06-13T10:50:34Z")

</div>

Hi @tbdori ,

If the requirement is to have only 4 sheets in your dashboard in the [STG account] , then you would have to work with template definition.  
1/Extract the json definition ( [describe-template-definition — AWS CLI 1.27.152 Command Reference](https://docs.aws.amazon.com/cli/latest/reference/quicksight/describe-template-definition.html) )  
2/Modify the json definition to remove the 2 sheets  
3/Update the dashboard by using the new definition ( [update-dashboard — AWS CLI 1.27.152 Command Reference](https://docs.aws.amazon.com/cli/latest/reference/quicksight/update-dashboard.html) )

Kind regards,  
Koushik

---

<div class="post-metadata">

**Author:** ![tbdori](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@tbdori](https://community.amazonquick.com/u/tbdori)\
**Post date:** [June 29, 2023, 11:44am UTC](https://community.amazonquick.com/t/how-to-update-template-im-getting-resource-creation-can-only-be-done-from-one-sourceentity-or-definition-error/13412/5 "2023-06-29T11:44:54Z")

</div>

Hi, Koushik

As you suggested , I did the following but it seems that JSON output is not legit. What am I missing?

1. ran this to get JSON output of template definition  
aws quicksight describe-template-definition --aws-account-id $account\_a\_id --template-id $template\_id --version-number=$version\_no --output json

2. I deleted 2 sheets from this.

3. tried updating dashboard

aws quicksight update-dashboard --aws-account-id $account\_a\_id --dashboard-id $dashboard\_id --name $name\_ --cli-input-json file://./spend\_template\_def\_stg.json

1. results : failure

Parameter validation failed:  
Unknown parameter in input: “Status”, must be one of: AwsAccountId, DashboardId, Name, SourceEntity, Parameters, VersionDescription, DashboardPublishOptions, ThemeArn, Definition  
Unknown parameter in input: “TemplateId”, must be one of: AwsAccountId, DashboardId, Name, SourceEntity, Parameters, VersionDescription, DashboardPublishOptions, ThemeArn, Definition  
Unknown parameter in input: “ResourceStatus”, must be one of: AwsAccountId, DashboardId, Name, SourceEntity, Parameters, VersionDescription, DashboardPublishOptions, ThemeArn, Definition  
Unknown parameter in input: “RequestId”, must be one of: AwsAccountId, DashboardId, Name, SourceEntity, Parameters, VersionDescription, DashboardPublishOptions, ThemeArn, Definition  
Missing required parameter in Definition: “DataSetIdentifierDeclarations”  
Unknown parameter in Definition: “DataSetConfigurations”, must be one of: DataSetIdentifierDeclarations, Sheets, CalculatedFields, ParameterDeclarations, FilterGroups, ColumnConfigurations, AnalysisDefaults

---

<div class="post-metadata">

**Author:** ![Koushik\_Muthanna](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/koushik_muthanna/32/3290_2.png) [@Koushik\_Muthanna](https://community.amazonquick.com/u/Koushik_Muthanna)\
**Post date:** [June 29, 2023, 12:21pm UTC](https://community.amazonquick.com/t/how-to-update-template-im-getting-resource-creation-can-only-be-done-from-one-sourceentity-or-definition-error/13412/6 "2023-06-29T12:21:42Z")

</div>

Hi @tbdori ,

Looking at the error itself, your json file has fields which are not required as input parameters .  
Output the required json format for update dashboard using the CLI

`aws quicksight update-dashboard --generate-cli-skeleton > ./Downloads/upddash.json`

Update the json file with the details in those required values and use that file to update the dashboard

---

<div class="post-metadata">

**Author:** ![tbdori](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@tbdori](https://community.amazonquick.com/u/tbdori)\
**Post date:** [June 29, 2023, 12:54pm UTC](https://community.amazonquick.com/t/how-to-update-template-im-getting-resource-creation-can-only-be-done-from-one-sourceentity-or-definition-error/13412/7 "2023-06-29T12:54:03Z")

</div>

So, a little more detailed info on this is for future reference :

1. get the DS template definition in JSON
2. edit JSON based on skeleton

- remove sheets not needed from Sheets array
- leave Definition block only
- replace DataSetConfigurations with DataSetIdentifierDeclarations

1. run update-dashboard

My update command still fails as the sheetId is used in many filters like 32 places.  
Thus, it seems that I need to delete all those references and doing this in JSON seems to be very error prone.

An error occurred (InvalidParameterValueException) when calling the UpdateDashboard operation: SheetId present in FilterGroup is not found in the list of Sheets,  
at Filter Group xxx-e321-4676-a5b5-402f9b8e6f82,  
at Sheet xxx-0eb4-450e-9958-092dfb4fa433.

Is there any other easy way to do ?

---

<div class="post-metadata">

**Author:** ![Koushik\_Muthanna](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/koushik_muthanna/32/3290_2.png) [@Koushik\_Muthanna](https://community.amazonquick.com/u/Koushik_Muthanna)\
**Post date:** [June 29, 2023, 2:57pm UTC](https://community.amazonquick.com/t/how-to-update-template-im-getting-resource-creation-can-only-be-done-from-one-sourceentity-or-definition-error/13412/8 "2023-06-29T14:57:05Z")

</div>

@tbdori ,

The other easier way to do this which I can think of  
1 : [UI Based] Make a copy of analysis in DEV account and delete the unwanted sheets. It would have only those 4 sheets which are required.  
2 : [API Based] Create your template based on this new analysis in DEV  
3 : [API Based] recreate relevant analysis and dashboard in STG account using the template from DEV
