Forum Discussion
Report Server API pach datasource failing
A pbix report can have multiple data sources. I have not tried using this API, but I think at the very least you will need to include the "Id" attribute in your request json so that the server knows which data source you are updating.
If you use something like fiddler or the chrome dev tools you can see the body of the request that the PBIRS portal sends when you update a connection string through the UI. You could copy one of those requests and then start seeing if there are properties that the UI sends which you could strip out.
Hi.
The report only have one datasource and the Id for it is provided in the uri above.
Good point using fiddler.
I tried this but realised I cannot change the connectionstring at all i the GUI.
Both fields "Type" and "Connection string" are greyed out.
Is this a setting I can change on the server?
- d_gosbell6 years agoSuper User
Anonymous wrote:The report only have one datasource and the Id for it is provided in the uri above.
So the Id in the uri should be the report Id. The data source Id would then be in the body of the report
I tried this but realised I cannot change the connectionstring at all i the GUI.
Both fields "Type" and "Connection string" are greyed out.
You definitely can't change the type of the data source. It would break your query if you changed the type. And from what I've seen they only support changing certain types of connections. We primarily have pbix reports in live connect mode and you can change the server/database for those. But I don't know if you can alter data sources for import mode models. These seem to be disabled in the UI, so I suspect the API won't let you change these either