web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Upload email attachmen...
Power Automate
Unanswered

Upload email attachment to Sharepoint folder

(1) ShareShare
ReportReport
Posted on by 2

I am trying to have an incoming email with an attachment automatically send that attachment to a sharepoint folder. 

 

Problem #1. I'd like it to go to the Sharepoint site's own email, but i'm not sure how to configure that. For now I have it going to my personal email, which will work alright. 

 

Problem #2. I can get the file to be uploaded to the folder, however often it won't open in Office 365. 

 

Problem #3. I anticipate many of the attachments that I want to upload will have the same name, which is why i'd like to get Flow to re-name the file based on the date. However, when I try this, it will add the date to the end of the file format causing issues opening. For example, testdoc.xlsx will be re-named to testdoc.xlsx1082018

 

The attachments will be excel files. In the event I can't get this working, what is the best way to create a list from an attachment when a new email is recieved? 

 

I can post screenshots if necessary, please let me know. 

Categories:
I have the same question (0)
  • scotth82 Profile Picture
    89 on at

    Hi Jhud2018,

     

    I imagine Problem #2 and #3 are related and can help you fix both.  Unfortunately not sure how the connectors work with SharePoint email addresses.

     

    1) So I'm guessing you are using the trigger 'When a new email arrives' and in the advanced options you mark the 'Has attachment' flag to 'Yes' and maybe add other filters such as specific subjects.

     

    2) Use the action 'Get email' and for the Message ID field use the 'Message ID' dynamic content field.  Also ensure you click the flag to 'Yes' for Include Attachments.

     

    3) Now we need to use the action 'Create file'.  Select the SharePoint URL and document library location.  In the File Name box we need to add an expression after the file name so we can add the date but we also have to change the file type at the end of it too.  So for example on my flow I have that field set to 'Weekly Report - [EXPRESSION].pdf where the expression is - formatDateTime(body('Get_email')?['DateTimeReceived'],'yyyy-MM-dd').

     

    This results in the file name "Weekly Report - yyyy-MM-dd.pdf.  You will obviously have .xlsx instead of PDF.

     

    Also then add in the 'File Content' field some dynamic content for 'Attachments Content'.

     

    1.png

     

    This should then allow you to open the file in Excel online.

     

    Hope this helps.

     

    Scott

     

  • GabrielStJohn Profile Picture
    on at

    Hello, @jhud2018!

    Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @scotth82‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!

    Thank you for being an active member of the Flow Community!

    -Gabriel
    Flow Community Manager

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard