web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power BI REST API - Ge...
Power Automate
Unanswered

Power BI REST API - GetDatasources

(0) ShareShare
ReportReport
Posted on by 17

Hi,

I am wanting to build out the Get Datasources Power BI REST API which looks like this:


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

 

I am trying to figure out how to pass through all of our Dataset Ids to compile a full JSON on the sources.

 

I have setup a GetDatasets flow to retrieve all the tenant's datasets, then Parse as a JSON and compose:

ML222_0-1695915092075.png


It works up to this point. However, I then want to extract all the Dataset id's into an array which can be used to pass through a 'For Each' loop and combined into a single output. I'm getting stuck at this point. I have tried following a few guides on converting a JSON object to an array following this type of setup:

ML222_1-1695915262840.png

When I run this, I get the following error on the For Each loop:

ML222_2-1695915295211.png

The outputs on the last "Parse Json" (which is being used as dynamic content) looks as expected and is full of data.

Any ideas please?






Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at
    However, I then want to extract all the Dataset id's into an array which can be used to pass through a 'For Each' loop and combined into a single output.

    That's pretty much what you are getting as the output of the API call.  You can feed that directly to your loop.

  • ML222 Profile Picture
    17 on at

    I still get that same error saying it needs to be a valid array when I take it directly from the API call.

    ML222_1-1695974327980.png

     



    ML222_0-1695974292221.png

     

  • lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at

    Inspect the raw API output. Could be [value] is empty?

     

    Does your output look anything like this? Datasets - Get Datasources - REST API (Power BI Power BI REST APIs) | Microsoft Learn

     

    Also note that your API call only goes after the "My Workspace"  datasets.  Maybe you wanted to use the other call?

  • ML222 Profile Picture
    17 on at

    Sorry, I am not sure what you mean. Do these help?

    ML222_0-1695993925824.pngML222_1-1695993967663.png

     

  • Verified answer
    ML222 Profile Picture
    17 on at

    @lbendlin Thanks for the help.
    The GetDatasourcesAsAdmin wasn't working so I tried some of the other GetDatasources to no avail, which is why I was on the My Workspace version of the api.

    However, the issue was with the value. I couldn't figure out why since the payload from the Parse JSON did not have any null. The problem was the code that the dynamic content wrote for the value. When using dynamic content it wrote:

    ML222_0-1696500525223.png


    I needed to remove that second ['body']  - so manually write in :

    ML222_1-1696500584832.png


    Now it ran correctly and looped in all the dataset IDs. (And on the Admin API)

    ML222_3-1696500735447.png


    Took 20min to run for 600+ Datasets FYI. I expected +-5mins as it was supposed to be 0.5sec per request as per the documentation, but I guess some throttling happened.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard