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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Polling Power BI Datas...
Power Automate
Unanswered

Polling Power BI Dataset refresh status (statusCode)

(1) ShareShare
ReportReport
Posted on by 2

When a Dataset is refreshed with the Refresh a dataset action, querying statusCode will return 202 as soon as the refresh is triggered.  I want to confirm that the refresh completed and test if it is 200 or 400 afterwards, to check if it was successful but, running int(actions('Refresh_a_dataset').outputs.statusCode) always returns 202.  How can I get the status to update after the refresh has completed?  I can see from the refresh history that it was well and truly completed before the do while timed out. 

RobertSlattery_0-1659964119314.png

 

Categories:
I have the same question (0)
  • TimeR Profile Picture
    32 on at

    Hi,  I'm looking to do something very similar, did you get a solution?  I have a power app where the user will trigger a flow and it is refreshing the dataset but I want to send back a running statuses so that the user will know when it has finished.

  • luamar Profile Picture
    6 on at

    @RobertSlattery did you find any solution to this? I am dealing with the same scenario 

  • TimeR Profile Picture
    32 on at

    I think there is a solution but I haven't put together yet.  I think you will have to make an http request to Power BI API to get the refresh history, as this shows if it is running or finished.  It would be easier if it was part of the standard connector, may be this could future feature request.

    https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/get-refresh-history

     

  • TimeR Profile Picture
    32 on at

    I do have a solution but it is not straight forward and might look more complicated than it really is.

    These are the steps I took

     

    Created an App Reg in AD and a custom connector - I followed this post https://medium.com/@Konstantinos_Ioannou/refresh-powerbi-dataset-with-microsoft-flow-73836c727c33 (just be care this post references POSTing a refresh, you want to do a GET)

    Then in the flow I called the custom connector to get the refresh history and parse to JSON, which means I could use the history data returned.

    There are many options from this point, loop to keep checking the status until complete, write to a table, display in the power app etc.

     

    jasonheaton_3-1665137785599.png

     

     

    jasonheaton_2-1665137637816.png

     

     

  • luamar Profile Picture
    6 on at

    Interesting... Is it working for you? I will give it a try early next week. Have you included a "Do until" control flow to loop until getting the desired StatusCode?

  • TimeR Profile Picture
    32 on at

    yes, I have used a "Do until" by parsing the result to JSON / schema but half way through completing the development, I've realised the workspace is only set to pro, so I can only make 8 API calls.  I'm going to pick it up again next week.  If I get the time, I'll try and fully document or at least I'll post a screen shot of the flow but there is a solution, it is just not very elegant.  It would be far easier if the OTB power bi connector had a return dataset history.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Jason any chance you could still post a screenshot of your solution. Currently working through this issue. Thanks!

  • TimeR Profile Picture
    32 on at

    I did developed a solution, the custom connector was really difficult to work with when deploying between environments and it would constantly need re-authenticating.  I used API calls via Data Factory.  I just found it really easy to work with Data Factory, I'm sure there are many other ways to do the same thing.

     

    so... Power App > Button > Executes a Flow > Flow makes an HTTP API call to a Azure Data Factory Pipeline which refreshes the Power BI dataset > Flow checks the status of the pipeline.   The pipeline was reusable for any Power BI dataset as it was parametrised.

     

    For the Data Factory I followed this post, I copied the json from the github into a new Data Factory and changed as needed - https://datasavvy.me/2020/07/09/refreshing-a-power-bi-dataset-in-azure-data-factory

    jasonheaton_3-1701794088610.png

    Within the flow I make an HTTP API call to Data Factory pipeline and check the status of the pipeline with a Do Until - The flow is heavily parametrised to make it environment agnostic.  It made it easier to deploy to different environments. 

    jasonheaton_5-1701794234770.png

    These are the MS docs I used as reference.

    https://learn.microsoft.com/en-us/rest/api/datafactory/pipelines?view=rest-datafactory-2018-06-01
    https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard