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 / corrupt .xlsx file in ...
Power Automate
Unanswered

corrupt .xlsx file in sharepoint for a file created in a automate flow

(0) ShareShare
ReportReport
Posted on by 31

Hello,

 

I am trying to create a excel file using a template and script. The file is saved in sharepoint and then sent out in an email.

I create a flow to perform these tasks. and the flow works and the file and emails are processed. However I am not able to open the .xlsx attachment.

 

The error opening on the attached .xlsx file in the email is "Excel cannot open the file ******.xlsx because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file. "

The error opening through sharepoint is " This workbook couldnt be opened because the file format may not be matching the file extension"

 

These are the flow steps:

Associate enters results in a form.

Flow

Step 1 Get responses

Step 2 Add rows to table ( not using table currently - will be at a later date)

Step 3 Get file metadata from a template I created ( have tried both; getting the file from one drive and from Sharepoint)

Step 4 Create a file into SharePoint folder

Step 5 Run Script

Step 6 Get File Content

Step 7 Send Email

Whichever way I create this Flow. Get data from sharepoint template, excel template, or one drive. I keep getting the same error message when trying to open the .xlsx file attached on the email and opening through sharepoint .

 

I have checked the file extension.  I have checked the access to the files were granted correctly, I have read response in the forum and outside the forum for days and have tried everything suggested that I could understand.  Help

 

T+2flow.jpg

 

 

T+2flow.jpg
Categories:
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at
  • Kris-t1969 Profile Picture
    31 on at

    I made suggested changes and getting the same error message.

    Krist1969_0-1693276112317.png

     

    Krist1969_1-1693276211788.png

     

  • lancedavis Profile Picture
    9 on at

    Kris - having the exact same issue.  Were you able to resolve?

  • Kris-t1969 Profile Picture
    31 on at

    Unfortunately, no.  I never got a solution, and it remains open.  Still trying to find a work around.

  • lancedavis Profile Picture
    9 on at

    Right after I posted this I found another suggestion and it turned out to resolve the issue.

     

    Found this:
    There's a known bug at the moment that throws an extra BASE 64() around the file content in the new editor. MS is aware and working on a fix. The legacy editor works correctly. The Base64() function that shows in your code shouldn't be there.

    I had to switch to legacy and delete and re-create the Get File Content block.  After doing so, it worked.
    Wasted an hour trying to figure this out.  😐

    Anyway... hope that helps.

  • nicbeament Profile Picture
    2 on at

    Hi lancedavis

     

    Sorry to ask, what do you mean "switched to legacy".

  • n3h11 Profile Picture
    3 on at

    I think moving to the old designer and recreate the flow steps again, it worked for me.

    n3h11_1-1717004100068.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard