Forum Discussion
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
Microsoft 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
- Krish89
Helper II
- mahoneypat
Microsoft 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
Helper II