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 / Adding attachment to a...
Power Automate
Unanswered

Adding attachment to approval - Creates "Apply to each"

(0) ShareShare
ReportReport
Posted on by 13

When creating an approval, I wish to attach and attachment which was originally sent via email. Whenever I attempt this, it creates an "apply to each", which I suspect is due to the fact that there could be multiple attachments. There will only ever be one attachment based on the flow I have created. How can I prevent an "Apply to each".

Many thanks

Categories:
  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @HC123 

    In order to avoid the apply to each, you should get the first attachment within the email using the following expression:

    first(triggerOutputs()?['body/attachments'])

    assuming you're using the trigger "when a new email arrives".

    For instance, if you want to access the attachment name you should write the expression:

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

    And the same for other properties.

    Hope that helps!

    Ferran

     

  • HC123 Profile Picture
    13 on at

    Thanks for the detailed information. Could you please clarify where this expression should go? Is it being set in a variable, or elsewhere?

     

    Thanks again.

  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @HC123 

    You could use this expression in a Compose action, for instance. Use the output of the compose action in next steps when you need to access attachment content or attachment name.

    Hope it helps now!

    Ferran

  • HC123 Profile Picture
    13 on at

    Thank you for your help.

    I am running in to issues with the document when attached to an approval. I've tried the below to try and get the content of the file 

    first(triggerOutputs()?['body/attachments'])

    However, the file attaches visually, and the name is shown correctly, but the file won't open or display, regardless of the file type tested.

    I've also tried swapping the below 'name' swapped for 'attachment_content', and it returns this error.

    HC123_0-1673606160423.png
    Any advise would be greatly appreciated.

     

    Capture.JPG

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard