Showing results for 
Search instead for 
Did you mean: 
New Member

Downloading and Renaming email attached files

Hi guys.


So i'm trying to make a flow that dowloads an excel file that cames as an attachment on daily email (every day a new excel that need to be saved). Basically, I want to download that attachment to a OneDrive folder and automatically renamed it with the original file name and append a date so I can differentiate every file.


I'm achieving the download into the OneDrive folder, the thing is that everytime I try to append the date and open the downloaded file, it throws this error:




The flow is:



NOTE: Pls ignore the Convert time zone and the Variable steps


In the Create File step i'm using this expression (as suggested in here: Solved: Re: Download Outlook attachment and rename it - Power Platform Community ( 😞



But it doesn't work. I've also used some different solutions but still not working, when I try to open the Excel file throws an error:

How-To #1: Rename Email Attachments using Microsoft Flow – Fausto Capellan, Jr

Solved: File Format/File extension not valid - Using Flow ... - Power Platform Community (microsoft....


Aparently I'm corrupting the file in one of the steps, because when I don't append anything and let the file name as the original attachment, the Excel file downloads perfectly.


Thanks guys, I'll appreciatte any help.


Best regards!

Resolver III
Resolver III

Dear Sebastian,

I hope that the following helps you, it did for me:


If this is a solution, please indicate such in the thread.

Happy flowing,


New Member

Hi Koen!


Thx for the answer, I've had already tried the second step described on the article yoy share, but still wasn't working. I try with the first one but also didn't work. But good news!! I discover the root of the issue:


I was trying to handle trough the flow an Excel file that cames up on a daily basis, with that particular Excel, the flow keeps failing, so I tried sending a different Excel file as an attachment and this time works fine. I dont specifically know what is the matter, I mean, the original excel from the attachment is a .xlsx and the one that I use to test is also  a .xlsx.


The original attached excel is generated through a software and his reporting tool, this software automatically sends a excel report to a specific email. We changed the way this software exports the excel, and this ways the flow worked. So my theory is that the format used, in this case for a Excel file, matters in order to make the flow works.


The problem is solved, thank you guys!

Resolver III
Resolver III

Great, happy to hear this!

Please indicate solution in the thread for other users of the forum.

Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (1,798)