Forum Discussion
Change Paginated Report Dataset programatically
- 1 year ago
bradsy v-hashadapu
Sorry on my latency.Keeping the same datasourceName didnt help. I get now the following error:
| One or more errors occurred. ({ "code": "InvalidRequest", "message": "Rdl UpdateDatasources updateDetails should not contain duplicated datasource Id's" })
Invoke-PowerBIRestMethod -Url $endpoint -Method POST -Body $body
| Encountered errors when invoking the command: { "code": "InvalidRequest", "message": "Rdl UpdateDatasources updateDetails should not contain duplicated datasource
| Id's" }Mind you that if I put the same datasourceName how does it knows how to switch ?
To mention that the paginated report sits in a workspace(call it workspace1) and is connected to a dataset from another workspace (call it workspace2). What I want is to reconnect the paginated report to a dataset from another workspace( call it workspace3).
The service Principal is the admin of the workspaces.
That is not look like how the API works. The datasourceName does not change. You would use the same data source name, but update the connectionDetails.
bradsy v-hashadapu
Sorry on my latency.
Keeping the same datasourceName didnt help. I get now the following error:
| One or more errors occurred. ({ "code": "InvalidRequest", "message": "Rdl UpdateDatasources updateDetails should not contain duplicated datasource Id's" })
Invoke-PowerBIRestMethod -Url $endpoint -Method POST -Body $body
| Encountered errors when invoking the command: { "code": "InvalidRequest", "message": "Rdl UpdateDatasources updateDetails should not contain duplicated datasource
| Id's" }
Mind you that if I put the same datasourceName how does it knows how to switch ?
To mention that the paginated report sits in a workspace(call it workspace1) and is connected to a dataset from another workspace (call it workspace2). What I want is to reconnect the paginated report to a dataset from another workspace( call it workspace3).
The service Principal is the admin of the workspaces.
- ducky1 year agoAdvocate I
I think I figured it out: In the body i dont need 2 datasources. I would keep only the current one (with its datasourcename ) but change the connection details. so the documentation was wrong to show the body like that.