Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
mananchaya
Frequent Visitor

Update Existing GatewayId/DatasourceId to Paginated Report using REST API

I'm working on updating the data source to the paginated report using REST API.

I know the way to manually set it on the https://app.powerbi.com/, but I need the way to set it by the REST API call.

 

Currently, I'm using the 'UpdateDatasourcesInGroup' to update the connection details to the paginated report.

But when I called 'GetDatasourcesInGroup' of my paginated report, it returns the null value on 'DatasourceId' and 'GatewayId' of my data source name (which I have created on the Power BI Report Builder).

mananchaya_0-1637313631806.png

 

 

Does the power BI REST API have the method to call to rebind/update/set the shared/existing data source to the specific report?

Note: need the way to rebind/update/set like an image down below in form of the calling REST API.

 

mananchaya_0-1637312142015.png

 

Thank you.

1 ACCEPTED SOLUTION
mananchaya
Frequent Visitor

I've got the solution by calling the method to update the data source api twice.

 

Previously, I called this method: https://docs.microsoft.com/en-us/rest/api/power-bi/reports/update-datasources-in-group

But due to my report was connected to multiple gateways with the same connection string and credentials.

So, I have to:

  1. remove the duplicate data source which my report doesn't use - https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/delete-datasource
  2. call the update data sources in group twice - https://docs.microsoft.com/en-us/rest/api/power-bi/reports/update-datasources-in-group
    • first one: calling to update the database to 'tempDB' or the database name that is not the same as the correct one.
    • 2nd: calling to update to the correct one.

 

At first, I've only called to update to the correct one, but I think the report has already binded to that connection details, so the power bi won't re-map the data source/gateway to us.

View solution in original post

4 REPLIES 4
mananchaya
Frequent Visitor

I've got the solution by calling the method to update the data source api twice.

 

Previously, I called this method: https://docs.microsoft.com/en-us/rest/api/power-bi/reports/update-datasources-in-group

But due to my report was connected to multiple gateways with the same connection string and credentials.

So, I have to:

  1. remove the duplicate data source which my report doesn't use - https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/delete-datasource
  2. call the update data sources in group twice - https://docs.microsoft.com/en-us/rest/api/power-bi/reports/update-datasources-in-group
    • first one: calling to update the database to 'tempDB' or the database name that is not the same as the correct one.
    • 2nd: calling to update to the correct one.

 

At first, I've only called to update to the correct one, but I think the report has already binded to that connection details, so the power bi won't re-map the data source/gateway to us.

It is not working for me. Can you provide me with more details or a code snippet?

Regards

v-luwang-msft
Community Support
Community Support

Hi @mananchaya ,

 To the best of my knowledge, you need to update the RDL file before publishing for right now. That's the only way around it as far as I know right now.

Refer:

Embed paginated reports in your own application for your customers (Preview)

Reports - Update Datasources

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

Thank you @v-luwang-msft for your reply.

 

I've already tested to call this one:  Reports - Update Datasources, but it still doesn't work.

 

I'm trying to update the RDL file before publishing and investigating more on your reference document.

 

Best Regards,

Mananchaya

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors