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 / 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,865 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
    3,893 Super User 2025 Season 2 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,865 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,865 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

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard