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 / How to download Email ...
Power Automate
Unanswered

How to download Email Attachment from existing received email

(0) ShareShare
ReportReport
Posted on by 6

Hi 

I have seen lot of templates and Videos for automating New Email attachment download through power automate. But there is no option to download attachment from emails which is already been received, or Emails which is there in O365 mail box. How can we automate this 

Categories:
I have the same question (0)
  • rikdekoning Profile Picture
    281 on at

    You can use the Get Emails action to search your mailbox for specific emails (using the Search Query box) and then download the email attachment from that email(s).

    rikdekoning_0-1606812245088.png

     

  • madhu_kumar Profile Picture
    6 on at

    Hi Rikdekoning 

    Thank you for you reply, but I want to download this attachment to my one drive how can I do this 

  • rikdekoning Profile Picture
    281 on at

    I created an example for you to understand. Let's say I want to store the latest 10 Office 365 invoices into the Invoice folder of my OneDrive.

     

    I start my flow using a manual trigger (this can be anything), then I configure the following actions:

     

    Get emails (V3)

    This will get all emails matching certain criteria that you put in. In my case, fetch emails:

    • Inside Inbox folder (Folder)
    • Sent from Microsoft (From)
    • Read and unread messages (Fetch only unread messages)
    • Including its attachments (Include attachments)
    • The latest 10 emails (Top) - please not that the maximum is 24
    • With any importance (Importance)
    • Only emails that have attachments (Only with attachments)
    • That have 'invoice' in the subject (Subject filter)

    rikdekoning_4-1606825685553.png

     

     

    Get Attachment (V2)

    This will get all attachments for each mail that matches the criteria from your Get emails (V3) action as configured above.

    1. You need to select the Message Id from the Dynamic Content of your Get emails (V3) action as Message Id.
      This will put the action inside an Apply to each container.
    2. After that, you can select the Attachments Attachement Id from the Dynamic Content of your Get emails (V3) action as Attachment Id.
      This will put your action inside another Apply to each container, because this action will run on each attachment that is found on each fetched email.

    rikdekoning_1-1606825259616.png

    Create file

    This action will re-create the attachment inside your OneDrive. Make sure to put this action inside the second Apply to each container (so directly after the Get Attachment (V2) action).

    You can select whatever folder you want the attachment to be created in in the Folder Path. In my case, I used the Invoice folder in the root of my OneDrive. You can get the File Name from the Dynamic Content of your Get Attachment (V2) action, which is the Name attribute. The File Content can also be used from the Dynamic Content of your Get Attachment (V2) action, which is the Content Bytes attribute.

    rikdekoning_2-1606825440647.png

    With everything in place, your flow should look something like this:

    rikdekoning_3-1606825626668.png

     

  • madhu_kumar Profile Picture
    6 on at

    Hi Rikdekoning 

    Thank you for your reply and the steps. I have created the same flow and entered specific E-mail ID to fetch the attachment. But when I run the test the automatically  Email ID is getting removed from the section get emails and only last 10 Email Attachment are getting downloaded. I have attached the screech shot for your reference

    madhu_kumar_0-1606908953570.png

     

     

  • rikdekoning Profile Picture
    281 on at

    @madhu_kumar , I don't see anything strange in your flow configuration. Would you mind share the outcome of your flow run? (screenshot with all actions expanded)

  • madhu_kumar Profile Picture
    6 on at

    Hi Rikdekoning 

    Outcome of this is just the attachment of latest to 10 emails which are having attachments. But not specific Email which I have mentioned. 

    Issue is while I am running this test Email Id which I have mentioned is getting removed. This is no internal Email ID this is an external Email ID(Different Domain ), is this a problem 

  • rikdekoning Profile Picture
    281 on at

    Are you sure you have filled in a Subject filter? Otherwise you will only get the 10 latest emails as you describe.
    What do you mean by Email ID? The Message ID is related to your mailbox and should not be affected whether or not the mail has been sent from an external domain.

  • dperez13 Profile Picture
    432 on at

    barring the create file step, ive  tried this a dozen times and get an error on the apply to each 2 step, object instead of array, result must be a valid array

  • dperez13 Profile Picture
    432 on at

    "This will put your action inside another Apply to each container, because this action will run on each attachment that is found on each fetched email."

     

    not the correct container, idk why it doesnt..

    it puts it in item() apply to each/for loop container. you must use apply to each [attachments] inside your apply to each 2, it does not automatically do this

  • brendo6 Profile Picture
    2 on at

    I'm really close to getting this, everything seems to be running right but it only runs for 2 seconds and nothing seems to be happening after get e-mail. The only thing(s) that are different in my workflow are - in the second apply to each (after putting in attachment attachment ID) in the attachment ID field he output from previous step populates as current value and I tried to change to attachments which had no effect. Otherwise, in your picture you have message ID twice but I assumed you meant attachments attachment ID. Any advice?

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 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard