Forum Discussion

Krish89's avatar
Krish89
Icon for Helper II rankHelper II
5 years ago

How to pass parameter values to the url in Power query

Hello,

 

I am trying to fetch the list of datasources used in all the datasets at tenant level using the below api endpoint.

https://api.powerbi.com/v1.0/myorg/admin/datasets/{datasetId}/datasources 

Below is the power query which fetches the datasources for only one dataset, but I would like to get the datasources for all the datasets in the tenant.

How can we dynamically pass parameter values to the url to get all the datasets datasources?

 

 

Regards,

Krishna.

5 Replies

  • mahoneypat's avatar
    mahoneypat
    Icon for Microsoft Employee rankMicrosoft Employee

    You can make a table that has a column of all your dataset IDs and then add a custom column (or invoke a custom function) with your Source expression that concatenates that ID value as text into the larger expression

     

    Web.Contents("... part of URL/" & [ColumnWithDatasetID] & "/rest of url...")

     

    Pat

     

    • mahoneypat's avatar
      mahoneypat
      Icon for Microsoft Employee rankMicrosoft Employee

      Looks like appid is not a column, but a table.  You can add a custom column to a table that has a column called AppID and then use Json.Document(Web.Contents(..." & [AppID] & "...))

       

      Regards,

      Pat

      • Krish89's avatar
        Krish89
        Icon for Helper II rankHelper II

        Hi mahoneypat ,

         

        I parse the column name called AppID but getting the below error.

         

         

        Thanks,

        Krishna