cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Andrew17
Regular Visitor

Corrupted Excel File When Being Saved From Outlook

Hi,

 

I am trying to create a simple process to save all emails that come with attachments onto a specific folder on OneDrive. Every time this process works, it seems to create the file, but it is corrupt, and the file size becomes 1-3 KB. The original excel files that are being emailed are .xlsx. Am I doing anything wrong here?

 

 
1 ACCEPTED SOLUTION

Accepted Solutions

 

Hi @Andrew17 ,

 

Please consider using the following configuration to first check if the type of the original file in the attachment is as expected.

61.PNG

It is also recommended that you check whether the attachment you added can be opened normally before testing.

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Andrew17
Regular Visitor

Corrupted Excel2.jpgPower Automate Flow.PNG

yashag2255
Dual Super User II
Dual Super User II

Hey @Andrew17 

 

Can you share details on what you are passing in the file content for the create file action? can you check if it is a base 64 string or something else? based on that you might have to change the config a little to make this work. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi @yashag2255,

 

The content in the files is just text. There are no special characters in it as well. Just to test it out, I set up to receive a .xlsx file with only the word "text" in a cell, and the same thing happened. Is this what you were asking?

 

Hi @Andrew17 ,

 

Please consider using the following configuration to first check if the type of the original file in the attachment is as expected.

61.PNG

It is also recommended that you check whether the attachment you added can be opened normally before testing.

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

I'm having this exact same problem, but I noticed now that it seems to only be a problem when I'm testing a flow "using data from previous run".  When I do a fresh test from Outlook, it stored working files for me.

When the problem does occur, I observe that the files can be opened in the original email. And they will still work if I use File Explorer to drag them to a folder.  But if they are saved by Flow, the files are not able to be opened with an error "Excel cannot open the file name.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 file does match the format, it's a XLSX file. But something about flow is corrupting it from being saved. I'm using the default "save o365 attachments to OneDrive Business" flow and the create-file step is set to use 

I have the same problem here, and get the error below. The Power Automate process is somehow corrupting the file, versus a manual save/drag and drop that does not corrupt the file. I did not used to have this problem with the flow. However, I have also had an issue where my Power BI reports that are linked to the OneDrive files cannot refresh unless I manually save.  Previously, my flows worked and the files in OneDrive were fine, but I had to click on them in OneDrive (which kicked off the auto-save), and then my Power BI reports refreshed just fine.

 

"We're sorry, we couldn't open your workbook. It's possibly corrupt or using a file format that's not supported.

 

You'll need to open this in the desktop app."

Ruddi84
New Member

DO have the same problem here. Have created a very simple flow to save csv-mail attachment (files are always csv) and the flow runs smoothly except the file itself just contains one cell with a long string like: "IlRyYWluaW5nIE5yIiwiVHJhaW5pbmcgTmFhbSIsIlRyYWluaW5nIFRyYWplY3QiLCJUcmFpbmluZyBUaGVtYSIsIlRyYWluaW5nIERvZWxncm9lcCIsIlR (and so on and so on...)"

 

The files in the mails are perfectly fine csv-files with no issues whatsoever. 

The flow itself also runs perfectly but to me it seems the 'create file' option (sharepoint version) is not ok. 

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (55,865)