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 / Attach Attachment with...
Power Automate
Answered

Attach Attachment without Appy to each

(0) ShareShare
ReportReport
Posted on by 24

Hi

 

I'm using a 'Get Mails V3' to retrive items from a mailbox.  The filters I'm using will always ensure that only a single mail is returned.

When I have the results I'm sending an email and adding the single attachment I retrieved from 'Get Mails' action.

 

However PowerAutomate always wants to add 'Apply to each' when I add the attachment into my email which I'm trying to avoid to make my flow a bit cleaner.  I know this is by design because it expects multiple attachments but my filters always ensure only one file will be returned

 

Is there anyway round this? I'd prefer to add the attachment using a variable or some expression

 

thanks

Paul

Categories:
I have the same question (0)
  • Verified answer
    mahoneypat Profile Picture
    1,720 on at

    You can use this expression instead of the dynamic expression for your file content.  It gets the file content for first record of the table of attachments.

     

    triggerOutputs()?['body/attachments'][0]?['contentBytes']

     

    You can use this to get the attachment name.

     

    triggerOutputs()?['body/attachments'][0]?['name']

     

    Regards,

    Pat

     

     

  • midland192 Profile Picture
    24 on at

    Hi Pat

     

    That works

    If I had a few 'Get Mails V3' actions with different names how could I reference the name in the expression you sent me?

     

    Paul

  • CamCov Profile Picture
    123 on at

    Hi @mahoneypat, Does this still work? I am attempting to send the attachments of a list item through an MS Approval, but it is saying property 0 does not exist for both expressions:

    CamCov_0-1672955214156.png

    The list item where the attachment is held will only ever have one attachment and the trigger is "When an Item is Created". Any ideas? (The failed runs do return true for the has Attachments dynamic content)

     

    Any ideas or help would be greatly appreciated!

     

     

     

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 921

#2
Valantis Profile Picture

Valantis 801

#3
Haque Profile Picture

Haque 588

Last 30 days Overall leaderboard