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 / Get First Attachment i...
Power Automate
Answered

Get First Attachment in sharepoint list item with multiple attachments

(0) ShareShare
ReportReport
Posted on by 22

Hello, 

 

How do i get the first attachment from multiple attachments in a flow?

While in Powerapps we use First(ThisItem.Attachments) to get the first attachment on an item in the sharepoint list that has multiple attachments, how do i get the first attachment in flow when i need to send an email with attachment, but only first attachment. So far this is what i have. I get stuck at Get Attachments - Apply to each option. Not sure how to go ahead and pick only the first attachment out of multiple attachments.

Attachment.PNG

 

 
Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    @Saya 

    I don't think that you'll be able to rely on the order of the attachments.  You are going to need to loop through all attachments and make a decision based on some other property such as the file name.

    Can you provide a little more information on your requirement?

     

     

     

  • Verified answer
    v-litu-msft Profile Picture
    Microsoft Employee on at

    Hi @Saya,

     

    Does the first attachment mean the first attachment in the attachment list or the first attachment added to the attachments in time?

    If it is the first attachment in the attachment list, you could use the index to get it, for example:

    body('Get_attachments')[0]

    Annotation 2020-04-24 132320.png

     

    If it is the first attachment added to the attachments in time, there is no way could do it, cause there is no create time property in the attachment.

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • E_Lush Profile Picture
    3 on at

    @ScottShearer 

     

    Ok lets say my list will always have at most 3 attachments and I want to have emails sent at different steps in the process that contain Att1, Att2, Att3 individually at the given step. How would I select a given attachment if I know the filename starts with Att1, Att2, or Att3.

     

    To be more specific I am trying to partially automate my current purchasing process.

    Send RFQ (request for quote) to my vendor Att1-RFQ

    Send RFF (request for funding) to my organizations procurement group Att2-RFF

    Send INV (invoice) to accounts payable Att3-INV

     

    I can send one or all but I am having a hard time being 100% sure only the one I want gets sent not sending all 3 to the different groups.

  • ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    @E_Lush 

    At selected points in your Flow, loop through the attachments and have a condition in the loop that uses a string expression that evaluates the attachment title - you might use indexOf() or conatins().  When doing the evaluation of the attachment name, note that string comparisons are case sensitive - consider using toUpper() or toLower() here.

    Give it a try and, if you get stuck, create a new post with screen shots and I'll try to assist.

     

     

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!

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