Hi Community,
I have a flow that is using the Power BI Export to File action to export one of the page of a report then email to myself. The flow set up as MS's article, it's rather straightforward, and I have the right Pagename string (as in the screenshot). The problem is the attachment I received in the email is blank.
Now I tried to directly export this page of report in Power BI online in PDF and it shows perfectly fine. In theory, I should receive something just like that as I were to directly export the page via Power BI online. I just don't know what went wrong. I've done a lot reading/researching/googling, but can't find anything that can help. Anyone has any suggestions what else I could do to create the report that's not blank?
Thanks!
Edit: I found this comment so I changed page size to 16:9 and the issue persists.
Hi there! I am having the exact same issue as this thread, except I have been able to export and send other reports successfully so I know it is not an outlook exchange issue. I tested in Power Bi Rest API and retrieved the correct PDF from postman, but still when I test it in my flow it is blank. I tried in old designer and new.
My flow is as below. The red parts are for an image added to email body - this works as intended. I also included the code from the steps where I retrieve a blank PDF and another sample report where I retrieve a PDF with the content. As you can see they are nearly identical but one works and the other does not. The one thing I can think of that may be affecting is page size - the "good" PDF is letter size, but the blank PDF is 830 px by 1280 px. But the PDF is successful from API so it should be able to work in the flow too?? Please advise.
Hi Yueyun,
Thanks for your assistance. I checked with our IMIT and turned out that our outlook exchange "shields" this type of PDF attachment and turns them to blank for security reasons. So I will do some workaround but we know for sure the flow can create PDF file and deposit it somewhere in SP. Really appreciate your help!
S
Hi , @sc0rpiongirl
Thanks for your response! According to your description, you test successfully in Power Bi REST API and you can get the correct pdf from API. But it do not work in your flow.
Can you share your whole flow configuration in your side ?
Best Regards,
Yueyun Zhang
Thanks 🙂 ...Got it...and tested it....and it worked! It loaded the PBI report by page for me. So it should work in the flow right? I don't understand why the attachment I got in email via the flow returned blank then... I am certain the page number was correct. Any suggestion? Thank you again!
Hi, @sc0rpiongirl
Yeah... This api need to test in Postman instead of the "Try it".
Postman API Platform | Sign Up for Free
Best Regards,
Yueyun Zhang
Thank you Yueyun for your direction and screenshots...I tested on Reports - Get File Of Export To File In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn and I got the Response Code of 200, which seems to be good, except...the output indicating the file isn't proper...here is the JSON body... do you think it's just how this Power BI report was created causing the odd display? For context, it's data table using Matrix visual displaying various data points that were produced via pretty complex measures. The data fields have condition formatting set up to show different background color of cell/fields. The idea is to export the data visual directly. Using "Export" > "PDF" from Power BI online service does produce a nice PDF of the whole page so I think in theory, it should not prevent me to get such a PDF version using REST API at all...
Hi , @sc0rpiongirl
I test it in my side , you need to check if you pass the format in the http body:
Then you can use the Postman to test the pdf like this:
Best Regards,
Yueyun Zhang
Thanks for pointing the direction for testing the API...I found the gorupID and reportID in PowerBI report URL which are the two parameters marked mandatory, when clicking RUN I got 400 response code but not sure what this means though...
here is the error code in Body JSON
{
"error": {
"code": "BadRequest",
"message": "Bad Request",
"details": [
{
"message": "Error converting value \"\" to type 'Microsoft.PowerBI.ServiceContracts.Api.V1.FileFormat'. Path 'format', line 2, position 11.",
"target": "request.format"
}
]
}
}
Thanks!
Hi , @sc0rpiongirl
Thanks for your response! Can you try to use the Power BI Rest API to check if you can export PDF in your side?
Reports - Export To File In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
And you can also check if you meet the limitation in Power BI side.
Export Power BI embedded analytics reports API - Power BI | Microsoft Learn
Best Regards,
Yueyun Zhang
Thank you for the reply and testing screenshots. This flow is logically very simple so yes I did follow all the steps easily and triple checked all the necessary parameters etc. I also tried different PBI reports to see if the problem only exists with certain PBI reports but all the PBI reports in my workspace with the test getting blank PDF attachment (not personal but company level and group level since I don't have capacity to run my own workplace ie getting that error when I tested PBI reports in my own workspace but that's beside the point...)
I have absolutely no idea what the problem is :(.
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492