Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Error in the Exported PowerBI file (corrupted file)

(0) ShareShare
ReportReport
Posted on by 4

Hello dear community!

 

I created a flow to "Export a File For PowerBI Report" and then e-mail the file. An Error occurs when opening the Exported file generated by PowerAutomate saying the file is corrupted and cannot be opened. I tried to select PDF and PPTX file from the PowerBI extraction and I also guaranteed to write the extension in the file name I send from the email. 

Does anyone know how to solve this problem? 

My flow:

felipecanhetti_0-1699984570470.png

My configurations: 

felipecanhetti_1-1699984604678.png

felipecanhetti_2-1699984638523.png


Thanks in advance for all the good souls active in

 

  • tech2188_ATSG Profile Picture
    tech2188_ATSG 3 on at
    Re: Error in the Exported PowerBI file (corrupted file)

    Thank you all. Had the same issue and this fixed it. Reselecting was a critical part of the equation.

  • XYZUser Profile Picture
    XYZUser 30 on at
    Re: Error in the Exported PowerBI file (corrupted file)

    Yess, Forgot to mention that you need to reselect the power bi content file again in your email step 🙂

  • LukasG Profile Picture
    LukasG 8 on at
    Re: Error in the Exported PowerBI file (corrupted file)

    Thank you very much @XYZUser that was the right solution 😄 

    Although it was not enough to just hit the toggle, I also had to reselect the output from the PowerBI step in my email step for it to work. But now it works!

  • XYZUser Profile Picture
    XYZUser 30 on at
    Re: Error in the Exported PowerBI file (corrupted file)

    Hi,
    This seems to be a bug in power automate new designer. I was also facing this issue earlier.
    If you go back to the old designer (by disabling the new designer toggle present in top-right), then it'll surely work fine.

  • LukasG Profile Picture
    LukasG 8 on at
    Re: Error in the Exported PowerBI file (corrupted file)

    I have exactly the same issue and error message (also tried PPT but also says the file is corrupt) - would love if someone had a solution for this!

    The exports work fine when I do them directly from the PowerBI report...

  • felipecanhetti Profile Picture
    felipecanhetti 4 on at
    Re: Error in the Exported PowerBI file (corrupted file)

    It should be a small attachment since it is only a one-page report from PowerBI. 
    Where can I see the size of the file generated by the "Export from PowerBI" automation? (I tried downloading it, but it was saved as a JSON and I could not open that) 

    The error I receive from Adobe Reader is: 

    felipecanhetti_0-1700141392527.png

     

  • lbendlin Profile Picture
    lbendlin 7,597 on at
    Re: Error in the Exported PowerBI file (corrupted file)

    How large is the attachment? Base64 strings have a low size limit.

  • felipecanhetti Profile Picture
    felipecanhetti 4 on at
    Re: Error in the Exported PowerBI file (corrupted file)

    No, this "Base64" appeared after I saved the flow. Before saving, the text was like this:

    felipecanhetti_0-1700132634353.png

    The codes that appear are:
    * BI Export:

    {
      "type": "OpenApiConnection",
      "inputs": {
        "parameters": {
          "groupid": "myworkspace",
          "reportid": "70417e0a-1bf8-4488-b0cd-16f7ad6617f5",
          "ExportPayloadPowerBIReport/format": "PDF"
        },
        "host": {
          "apiId": "/providers/Microsoft.PowerApps/apis/shared_powerbi",
          "connection": "shared_powerbi",
          "operationId": "InitiateExportToFileForPbiReports"
        }
      },
      "runAfter": {}
    } "

    * Code the Email part:
    "
    {
      "type": "OpenApiConnection",
      "inputs": {
        "parameters": {
          "emailMessage/To": "felipe.oliveirac@kof.com.mx",
          "emailMessage/Subject": "TEste PBI",
          "emailMessage/Body": "<p>teste</p>",
          "emailMessage/Attachments": [
            {
              "Name": "Teste BI.PDF",
              "ContentBytes": "@{base64(body('Exportação_para_Arquivo_para_Relatórios_do_Power_BI'))}"
            }
          ],
          "emailMessage/Importance": "Normal"
        },
        "host": {
          "apiId": "/providers/Microsoft.PowerApps/apis/shared_office365",
          "connection": "shared_office365",
          "operationId": "SendEmailV2"
        }
      },
      "runAfter": {
        "Exportação_para_Arquivo_para_Relatórios_do_Power_BI": [
          "Succeeded"
        ]
      }
    }"

    It seems like its only Base64 encoding once
  • lbendlin Profile Picture
    lbendlin 7,597 on at
    Re: Error in the Exported PowerBI file (corrupted file)

    Are you trying to Base64 encode the file twice?

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard