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 / Using "Retrieve email ...
Power Automate
Answered

Using "Retrieve email messages from Outlook" to download attachments one at a time for processing

(0) ShareShare
ReportReport
Posted on by 228

Hello All,

 

I need to look for unread emails based on subject heading then save a specific xls attachment that always comes on this email. I would like to handle this attachment as a variable then open it, copy data from it and add it to a xlsx master template. Repeating this sequence until all emails processed that match.

 

I was using a cloud flow for some of this processing but scope has changed and it can't be real time. The user wants to kick off this automation manually and have it go through the emails.

 

Any ideas? Would appreciate letting me know what triggers or loops to use if possible.

Thanks! 

I have the same question (0)
  • fraenK Profile Picture
    2,125 on at
  • r96359 Profile Picture
    228 on at

    Thank you.

    The issue is that "Retrieve email messages from Outlook" downloads all attachments in one pass. Thus overwriting or renaming filename(1). I am looking for a solution that Downloads one email at a time and runs through the process of saving the attachment, processing it, then moving to the next email until all emails are processed.

     

     

  • r96359 Profile Picture
    228 on at

    @miketran13 I'm back to needing to solve this in PAD only. Really appreciate your previous help.

    Would you mind answering a few questions regarding you recommendation in a previous question post?

     

    Your help to clarify would be greatly appreciated!

     

    1. Open Outlook

    - understood

    2. Retrieve email from Outlook folder to see how many emails do you have.

    - understood

    3. Navigating to the Outlook folder that you want to retrieve the email (Inbox or RPA folder)

    - understood

    4. Double click on the first email

    - Would I be doing this in a recording? I don't see this as a predefined action. 

    5. Save the attachment if any. 

    - Would I be doing this in a recording? I don't see this as a predefined action. 

    6. Process the data from the attachment

    - understood

    7. Move the email to the RPA Done folder if success, or Failed folder if it failed

    - understood

    8. Delete the files

    - understood

     

    Then repeat the step 2 until step 8. By using this, you will alway need to move the emails that is success or failed and then repeat the step for retreiving emails. If there is no emails that match the conditions, then the flow should be stopped.

  • fraenK Profile Picture
    2,125 on at

    You just need to retrieve all emails matching your criteria first with disabled attachment saving. Then loop through the resulting list and run the command again with the respective email details as filter and enabled attachment saving. Process the attachment, clear the folder, next. No need for UI automation.

  • r96359 Profile Picture
    228 on at

    Brilliant @fraenK. Let me try that!

    So use the variable of lets say email_list generated from Retrieve email messages 1st pass.

    Then do a for each email_list item performing Retrieve email messages again with DL attachment.

    So in this for each "Retrieve email messages" would only see one email at a time? 

    The rest is clear, process file, remove file, next item in loop.

  • fraenK Profile Picture
    2,125 on at

    yes, just fill the filter (from, to, subject etc.) of retrieve email messages with the details of the current email item

  • r96359 Profile Picture
    228 on at

    Thanks @fraenK 

    I have all the emails coming from another system so they have the same To, Subject Heading, and file attachment name. Will this solution still work with this scenario? 

  • Verified answer
    fraenK Profile Picture
    2,125 on at

    If even the body is the same then this won't work. But there shouldn't be an issue processing all saved attachments for all returned emails as they are referenced in the output variable. 

  • r96359 Profile Picture
    228 on at

    Thanks @fraenK . I'll give that a try.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 253 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 172 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 134 Super User 2026 Season 2

Last 30 days Overall leaderboard