Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

Save my CSV email attachments to a SharePoint document library

Hi, I have a data system sending me a daily email with an attached CSV file containing sales data.  I am trying to get this file into my Sharepoint document library so I can use it as a data source for Power BI.


I am using this standard flow template: Save my email attachments to a Sharepoint Document Library to take that attachment and save to Sharepoint.


The flow seems to run fine, however the CSV file that is saved in Sharepoint is complete gibberish




Below is the "Create File" part of the flow.  Note: I have an email rule set up to move these data emails to a particular folder, and the flow is only looking for new emails in that folder. Each email only has one attachment, Phocas.csv.




Community Support
Community Support

Hi @Sandie ,


I used the template you provided on my side to test it, and did not meet the problem you mentioned.

After the file is opened, it is consistent with the content of the original file.

Try to use Attachment Name to configure the File Name field directly. If you fill in a fixed value, it will cause the file with the same name to be overwritten.

If you just want to save the attachment file to SharePoint library every day, try using the following configuration directly:


Please take a try and let me know if issue still exist.


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.
New Member

so, I am having a similar problem with CSV attachnments saving to sharepoint. except mine do not save at all instead of giving gibberish.. it looks like a large csv (15Mb) wouldnt work, but a csv of size 200Kb works fine.

the problem doesnt occur with other type of attachments (xlsx, Pbix...etc) only csv.

New Member

I had the same issue with the gibberish, but then when I used a different trigger it worked.2020-04-03 14_57_50-Edit your flow _ Power Automate.png


Use the Get Email action card just below the when a new email arrives, then use the dynamic content coming from Get Email action card. This will create the attachments in SharePoint without corrupting your files.


@Kyle411 Please go ahead and accept this as a solution if this works.

Frequent Visitor

Using the attachment name does work, but if we wanted to have the file as a custom name, like Report.csv, then the contents are not displayed properly.

How can we save with a custom name, extension of csv


Edit: I was trying to save my attachments with spaces in them, which caused the content to be gone, but once I removed spaces from the naming, I was able to name it however I desired.

Regular Visitor



I had the same problem with the gibberish and after some playing around, managed to fix it by using 'Content Bytes' in the 'File Content':



Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,701)