Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bBI
Frequent Visitor

: Power Automate flow that sends mail AFTER power bi refreshes

Got a simple flow set up:

 

1. Data appears in sharepoint folder

2. Power BI refresh iniated

3. Delay 15 minutes (this is to give PBI time to refresh)

4. Send mail to users

 

Today I received some complaints because the mail went out while the data hadn't been refreshed yet (i.e. people received the mail to soon)

 

Is there a way to replace step 3 by a step that checks for "received confirmation refresh ended successfully"?

5 REPLIES 5
rahulstomar08
Frequent Visitor

hi @lbendlin 

can you please elaborate on your point?

How can we use REST API in power automate to send email 'AFTER' our data gets refreshed.I have used this flowI have used this flow

Not sure how much more there is to say - call the API I mentioned (for example every five minutes) until the top entry of the resulting JSON has an "endTime'  value and a status that (hopefully) says "success".

 

This is different from dataflows where Power Automate can actually be triggered by a dataflow refresh completion directly.

lbendlin
Super User
Super User

Absolutely.  In Power Automate periodically poll the Power BI API to inquire about the dataset refresh status.

 

https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getrefreshhistory  

(or the premium equivalent)

 

The refresh is complete when the first returned entry has an endTime value and a status other than "unknown"

Hi @lbendlin 
i am trying to do what is suggested in the link : ttps://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getrefreshhistory  

I am using HTTP request after the Refresh a dataset step in power automate

method as GET
URL 
https://api.powerbi.com/v1.0/myorg/datasets/xxmydatasetidxx/refreshes
however it fails saying " Action 'HTTP' failed 

Do i need to mention any other details in HTTP ?

please guide . Thanks in advance

yes, you need to authenticate.  Look at the sandbox example. Then decide how your auth process works and provide the details accordingly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors