Forum Discussion

Korlay37's avatar
Korlay37
Frequent Visitor
2 years ago

PBI parametrized datasource report Upload with REST API and modify datasource through API Bad Req

Hello, 

I have an application and I am implementing a report upload with the PBI REST API functionality which is working but I notice that once I import the pbix report with parametrized server and database information (which are just text) in Fabric if I go and check the semantic model settings there ARENT any parameters there.

 

In my desktop app I have the parameters with "Enable load":

And when I click the Semantic model in fabric I can see the parameters there as tables:

And if I try to update the parameters with the PBI Rest API (https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/update-parameters-in-group ) I get a bad request:

The flow that I need:
User uploads a report through my app where I use REST API, Then I need my app to make a series of changes using the REST API for refresh and to set the correct datasource because the Users datasource will be some localhost port. I use parameters because the PBI API says that I should use the Update parameters in group to update the Datasource in my use case:

I hope someone can help me out!

5 Replies

  • I can see you defined the data source as a table not a parameter this is the reason

    you should create parameter in power query for the source and use it in the connection

    • Korlay37's avatar
      Korlay37
      Frequent Visitor

      muhssamy How so?

      I created the parameters when defining the  origin of my data, there they show as parameters and they are selectable when I select parameters as my connection information:

      If I go to Transform Data -> Edit parameters they show there: 

       

      If I open the transform data I see them there as parameters, I do not see any indication of them being tables:

       

      • Korlay37's avatar
        Korlay37
        Frequent Visitor

        muhssamy After some testing it seems it is because I am publishing/importing it using the REST API instead of using publish from the desktop app... If I try and publish using the desktop app the parameters show up. So I am trying to understand why they do not show up when I use the REST API