Skip to main content
Community site session details

Community site session details

Session Id : YdM/TDzTaMYUh5VWF/Rjmd
Power Automate - Process Mining
Answered

Attach Attachment without Appy to each

Like (0) ShareShare
ReportReport
Posted on 23 Mar 2021 08:54:02 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:
  • CamCov Profile Picture
    123 on 05 Jan 2023 at 21:48:09
    Re: Attach Attachment without Appy to each

    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!

     

     

     

  • midland192 Profile Picture
    24 on 23 Mar 2021 at 16:35:25
    Re: Attach Attachment without Appy to each

    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

  • Verified answer
    mahoneypat Profile Picture
    1,720 on 23 Mar 2021 at 11:53:05
    Re: Attach Attachment without Appy to each

    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

     

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Loading complete