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 / Action 'Get_Attachment...
Power Automate
Suggested Answer

Action 'Get_Attachment_(V2)' failed

(1) ShareShare
ReportReport
Posted on by 7
I have a simple flow that flow that has two loops.  I'm having issues with the get attachments in the second loop.  it's simple request to get all the emails form an outlook folder and move them to a subfolder and then also write them to SharePoint  
This works fine.    Issue:  I'm also checking to see if the emails have an attachment so if it does I'm writing the attachment as a file.   This works great if you write with a trigger "When the email arrives but this is a get mail loop.  There are no examples.  it sees all 3 attachments but the get attachments can't find the attachments and the action fails with this error. 
 
Thanks
Categories:
I have the same question (0)
  • Suggested answer
    Jon Unzueta Profile Picture
    1,834 Super User 2026 Season 1 on at
     
     

    You're running into a common issue when using the "Get emails" action in a loop (instead of the "When a new email arrives" trigger) and trying to retrieve attachments. Here's a breakdown of what's likely going wrong and how to fix it.


    🔍 Why the "Get attachments" action fails in a loop

    When using "Get emails" (e.g., from a folder), the returned email objects do not include full metadata like the MessageId or InternetMessageId that the "Get attachments" action expects. This causes the action to fail even though the email clearly has attachments.


     Fix: Use the correct identifier for "Get attachments"

    To retrieve attachments from emails in a loop, you need to:

    1. Use the "Get emails" action to retrieve messages from a folder.
    2. For each email, extract the Message Id (not Id or Conversation Id).
    3. Use that Message Id in the "Get attachments" action.

    🛠️ Suggested Flow Structure

    Here’s a simplified structure that should work:

    1. Get emails (V3) from folder.
    2. Apply to each email:
      • Move email to subfolder.
      • Write email metadata to SharePoint.
      • Condition: If HasAttachments is true:
        • Use "Get attachments (V2)" with the Message Id.
        • Apply to each attachment:
          • Use "Get attachment content".
          • Create file in SharePoint.

    ⚠️ Common Pitfalls

    • Wrong ID used: Make sure you're using the Message Id from the email object, not the Id of the loop item.
    • Attachments not loaded: The "Get emails" action doesn't load attachments by default—only metadata.
    • Rate limits: If you're looping through many emails, you might hit throttling limits.
     
     
    🏷️ Tag me if you have any further questions or if the issue persists.
    ✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems.
    ❤️ Give it a Like if you found the approach useful in any way.
  • Michael E. Gernaey Profile Picture
    53,969 Moderator on at
     
    I checked out your flow just to be sure.
     
    1) Be careful as you exported it with your connections etc which show your email address.
    2) unfortunately due to what you have configured, I cannot directly import it to review it.
     
    So I had to review it in Notepad++ lol which is not very fun :-). So next time you might want to just paste some pictures in :-)
     
    Looking at it, you are in fact using the wrong id
     
    "messageId": "@items('Apply_to_each')?['id']",
     
    You do need to use the Message Id
     
    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey
  • DT-01082229-0 Profile Picture
    7 on at
    Thank you for your responses.   I am definitely using MessageID in the Get Attachment (V2) action.    I will also add the get Attachment content after the GET Attachment but Not sure if that will help since the issue is in the GET ATTACHMENT action.  its not getting passed it.   
     
    I am using GET EMAIL instead of "When the mail arrives" because I need to move an entire existing folder to SharePoint.  Special Email retention process for super old emails that's not part of our retention policy.     I have a flow that works with that action.  It issue is this is the second loop in the flow.  
    First loop gets the emails, moves them in outlook, exports them, writes them to SharePoint.   The second loop for each email checks the attachment and trys to write the attachment to SharePoint.   The issue is it can't find the attachment , even though the log says HasAttachment = true.   
     
    I will add screenshots: 

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 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard