Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Process Mining
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:
  • CamCov Profile Picture
    123 on at
    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 at
    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 at
    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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Process Mining

Overall leaderboard