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 / Save my CSV email atta...
Power Automate
Unanswered

Save my CSV email attachments to a SharePoint document library

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

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

 

excel-gibberish.JPG

 

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.

 

file-creation.JPG

 

Categories:
I have the same question (0)
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    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:

    3.PNG

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

     

    Best Regards,

  • nabjad Profile Picture
    2 on at

    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.

  • Kyle411 Profile Picture
    5 on at

    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

  • v-imbas Profile Picture
    Microsoft Employee on at

    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.

  • JeremieS Profile Picture
    11 on at

    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.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey,

     

    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':

    DanMcG_0-1644979940625.png

     

  • Belin Profile Picture
    on at

    this worked for me, thanks

  • pmenown Profile Picture
    3 on at

    I ran into the same issue when using the 'When a new email arrives in a shared mailbox (V2)' Outlook Trigger and trying to save a CSV file attachment and i believe the test functionality creates a dummy .csv file with random data  (IkhEUiIsIkRMNTAwMSIsIkJST0tFUiBERVRBSUxFRC...). However when the flow was triggered by sending a real email the content was perfectly legible.

  • L-T_Emma Profile Picture
    15 on at

    I had the same issue and this is the only fix that has worked for me.  Thank you 🙂

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard