Forum Discussion
Issue with nameConflict=Overwrite for RDL in Workspace Folders using Import API
Description:
I am using the Imports - Post Import In Group REST API to publish an RDL file to a Power BI workspace.
Scenario:
- When publishing to the root level of the workspace:
- Using nameConflict = "Abort" correctly returns a 409 Conflict if a report with the same name exists.
- Using nameConflict = "Overwrite" successfully updates the existing report.
- However, when publishing to a folder inside the workspace:
- Using nameConflict = "Abort" does not return a 409 conflict.
- Instead, it creates a new report with the same name inside the folder, but with a different report ID.
Problem:
When I try to overwrite that report (inside the folder) using:
"nameConflict": "Overwrite"I get the following error:
NotFound - Not Found
DuplicatePackageNotFoundErrorPayload (for reference):
{
"reportName": "Sales Analysis",
"dataSource": {
"powerBIDatasetName": "Sales Sample",
"powerBIWorkspaceName": "Demo Workspace"
},
"datasets": [
{
"tableName": "Owners",
"columnName": "Owner",
"dataType": "String",
"isMeasure": false,
"summarizeBy": "None",
"formatString": "",
"measureExpression": ""
},
{
"tableName": "Owners",
"columnName": "Manager",
"dataType": "String",
"isMeasure": false,
"summarizeBy": "None",
"formatString": "",
"measureExpression": ""
},
{
"tableName": "Territories",
"columnName": "State Or Province",
"dataType": "String",
"isMeasure": false,
"summarizeBy": "None",
"formatString": "",
"measureExpression": ""
}
],
"parameters": [
{
"parameterName": "State Or Province",
"tableName": "Territories",
"columnName": "State Or Province",
"promptText": "State Or Province",
"defaultValues": ["AK", "AR"],
"hideParameter": false,
"dataType": "String"
}
],
"publishRequest": {
"groupId": "e46ad210-xxxx-44b1-8e64-db61dxxxxxx",
"nameConflict": "Overwrite",
"folderId": null
}
}
Question:
- Why is nameConflict not behaving consistently for reports inside folders?
- Is overwrite not supported for folder-scoped items, or is additional identification (like reportId or folderId) required?
- How can I correctly overwrite an existing RDL report inside a folder?
6 Replies
- AmiraBedhSuper User
Hello !
Thank you for posting on MS Fabric community.
I think workspace folders don’t behave like independent name scopes as the names must be unique across the whole workspace not just within a folder and I think that what explains why you feel that the folder based conflict handling is somehow inconsistent.
I have experienced something similar in the past and what I remember it can be a mismatch between an old import API semantics and the newer workspace folders model or a bug you are having in RDLs in folders.
https://learn.microsoft.com/en-us/fabric/fundamentals/workspaces-folders
What I can assure you is thenameConflict is not folder scoped and there is no extra identifier like reportId for overwrite in the import call since for folder placement the selector is subfolderObjectId and not folderId.
When I check your code I am a lillte bit confused because the REST for this endpoint expects thegroupId in the URL path, nameConflict in the query string, subfolderObjectId in the query string and the body to be the multipart file upload or import payload and not a publishRequest wrapper with folderId
So for an RDL in a folder, the call should look more like:
POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/imports ?datasetDisplayName=Sales%20Analysis.rdl &nameConflict=Overwrite &subfolderObjectId={folderId} Content-Type: multipart/form-dataWhat you can do is to list existing items in the workspace and find the existing paginated report by name then you treat the name as workspace unique and not folder unique because the Fabric items API exposes folderId on items, so you can verify where the existing item actually lives.
And f the item already exists you have 2 cases : if it is already the intended report you try importing with the same name and subfolderObjectId otherwiseif the overwrite still fails with DuplicatePackageNotFoundError you either delete or reimport or you simply import and overwrite at the workspace scope and then move the item to the folder.
- V-yubandi-msftCommunity Support
Hi tks1011 ,
To add to the AmiraBedh response, The Import API does not completely match folder semantics, particularly for RDL reports. This can cause situations where Abort does not return a conflict, and Overwrite leads to a DuplicatePackageNotFoundError.
As a workaround, it is suggested to check for existing items at the workspace level before importing. You can either delete and re-import the item, or import it first and then move the report to the correct folder.
Thank You.
- V-yubandi-msftCommunity Support
Hi tks1011 ,
We haven’t received a response yet. Please let us know if you need any additional details or clarification from our side.
Thank you.
- tks1011Frequent Visitor
Hi V-yubandi-msft
We are currently investigating the issue and actively working toward a resolution.- V-yubandi-msftCommunity Support
Thank you for the information. Please let us know if you need any additional details or clarification from our side.
- V-yubandi-msftCommunity Support
Hi tks1011 ,
May I know if your issue has been resolved? If you still need any additional details or clarification, please let us know.
Thanks.