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 / download attachments f...
Power Automate
Answered

download attachments from emails

(3) ShareShare
ReportReport
Posted on by 21
hi all,
as a regular user of power automate i'm glad to give my contribution to the community
Previously, we daily received an email from a provider and I built a flow to extract the attachment and create a file in sharepoint (see pic below)
 
Now the provider no longer sends e-mails with the direct attachment but has included it in an outlook item (see pic): i.e. an .eml file
 
 
how can i modify the flow to get the "outlook item", open it and get the attachment?
 
thanks for your cooperation
Dario
 
 
 
Categories:
I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,985 Most Valuable Professional on at
     
    You won't be able to directly extract using Power Automate. The issue here is your attachment is an email and inside that email there are attachments. There is a way to do this. So create a Azure Function app then pass the email attachment to function app. Function App will return the content and filename. Using that you can create the file in SharePoint or Onedrive.
     
    I will create a video soon and share the code (Azure Function via Github repo) soon.
     
     
  • DV-17061327-0 Profile Picture
    21 on at
    many thanks for your prompt reply.
    many questions in different steps. never used Azure Function app so a video would help so much.
    not clear what to insert in those functions brackets:
     
    then
     
     
    have a good day
  • Suggested answer
    Riyaz_riz11 Profile Picture
    4,048 Super User 2026 Season 1 on at
    Hi,

    Trigger: When a new email arrives (V3)

    • Folder: Inbox

    • Subject filter: Use Subject Filter as "ApprovalsTest" or whatever your provider uses.

    • Include Attachments: ✅ Yes

    • Only with Attachments: ✅ Yes

    2. Condition (Optional but useful)

    To ensure the email has the correct subject:

    • Condition:

      Subject contains 'ApprovalsTest'

    3. Apply to Each (Attachment)

    • Input: Attachments from the trigger

    4. Create File in SharePoint

    • Site Address: Your SharePoint site

    • Folder Path: e.g. /Shared Documents/ApprovalsTest

    • File Name: Attachment Name

      Name (dynamic content from attachment)

    • File Content:

      ContentBytes (dynamic content from attachment)

      If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
      Regards,
      Riyaz
  • Verified answer
    abm abm Profile Picture
    32,985 Most Valuable Professional on at
     
    Yes, your answer is correct regarding email attachments. However, the question is about an email that has another email attached. The attached email contains its own attachments that need to be extracted. For this, we need custom code to help, as Power Automate cannot extract attachments directly in this scenario.
     
    @DV-17061327-0 will record one today and post it and share the code as well.
     
    Thanks
  • Verified answer
    abm abm Profile Picture
    32,985 Most Valuable Professional on at
     
    Here is the video
     
    Part I
     
     
    Part II
     
     
    Here is the githhub repo where you can download the source. The main code is under the function_app.py
     
     
    If you find this useful please accept it as solution accepted, like my video and subscribe. Really appreciate it.
     
    Any questions please let me know.
     
    Thanks a lot
     

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 523

#2
Valantis Profile Picture

Valantis 318

#3
David_MA Profile Picture

David_MA 235 Super User 2026 Season 1

Last 30 days Overall leaderboard