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 / Save email attachment ...
Power Automate
Answered

Save email attachment from the latest email only

(0) ShareShare
ReportReport
Posted on by 11

Hi all,

Context:

I receive an email from a specific sender on a weekly basis and these emails contain an attachment I use to publish a report.

I cannot delete old emails from this sender (I keep all the emails in the Inbox), but I only use the latest email`s attachment to update my report.

 

I tried to use the "Retrieve email messages from Outlook" action and set it to save attachments, but it saves the attachments from all emails (latest and old ones).

 

Do I have to create a list of those emails in chronological order and somehow make Power Automate retrieve only the first one on that list? How should I do that, please?

 

Thanks 

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    In the Retrieve email messages function there is a selector box for "Unread only".  So, if you are doing this each week and only reading one at a time, this should be sufficient.

     

    Good luck!

  • LeoTS Profile Picture
    11 on at

    Thanks @MichaelAnnis , but I have tried that as well.

    I doesn`t work because I have to reply to the sender confirming the attachment is correct. If it is, I then proceed to create the report; if it is not, I have to wait for another email with a new attachment.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Two ways you can tackle this. 

     

    1)  if you are already reviewing the email manually, you could always right click and mark the email as unread after you approve the invoice.

     

    2)  If you just want to continue to "Retrieve" them all, then I believe the Retrieved Emails starts with the most recent on top, which the most recent email will always be %RetrievedEmails[0]% and the attachments for just that email will be %RetrievedEmails[0].Attachments%

     

    Retrieved Emails is nothing more than a list of email variables, so [0] tells it to get the first one from the list.  [1] is the second, and so on.

  • LeoTS Profile Picture
    11 on at

    Thanks again for your input.

    The variable %RetrievedEmails% is created when the "Retrieve Email messages" is executed, but at this point all emails` attachments have been saved into the folder already, and that`s what I`m trying to avoid.
    I think the %RetrievedEmails% list must be created before I run the "Retrieve Email messages" action, otherwise I cannot select just %RetrievedEmails[0]%.

    I have attached 2 images of how I`m trying to execute that action, if that helps somehow.

    steps.jpg

     

     

     

     

     

    step12.jpg

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Remove save attachments into and do it yourself later.

     

    move files %RetrievedEmails[0].Attachments% to wherever. 

  • LeoTS Profile Picture
    11 on at

    I must be doing something wrong, because I`m not saving the attachments anymore and I created step 417 right after retrieving the list of emails with attachments to move the attachments to a specific folder, but no files get moved.step1.jpg

  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    My apologies.  I thought I did this before, but it turns out that I do use the Save Attachments part of the retrieve email in my flow.  I've got another one.  A little weird, but it should work:

     

    First, Retrieve Emails (all of them, but no attachments).

    Then, Process email messages in Outlook to process %RetrievedEmails[0]% and the operation should be Mark as Unread. 

    Then, Retrieve Emails again, but this time, just unread emails, and save attachments.

  • LeoTS Profile Picture
    11 on at

    That did the job! Thanks for your help.

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard