Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

Avoid multiple apply to each when adding SharePoint list attachment

(1) ShareShare
ReportReport
Posted on by 17
Hello All,
 
I am creating a flow where I need to read SharePoint list items then check if they have attachments, if they have attachments I need to process them. The process that I am using is using Get Items to get list items, then Get attachments to get the attachments in the list item and then get attachment content to get the attachment content. The flow runs slow as it creates nested apply to each, first apply to each in get attachments and 2nd apply to each in get attachment content. Is there a way to optimise it even if it's something related to send http requests it would be fine. Please guide if anyone has come accross this 
  • Ravindra Jadhav Profile Picture
    Ravindra Jadhav 240 on at
    Avoid multiple apply to each when adding SharePoint list attachment
    Hii Hope you are Doing Well,
    To optimize your SharePoint flow where you need to handle list items with attachments,  We Can Do this Process much faster by usinh graph apis,
    You can use below end point to get attchment conntent
     
    GET /drives/{drive-id}/items/{item-id}/content
    GET /groups/{group-id}/drive/items/{item-id}/content
    GET /me/drive/root:/{item-path}:/content
    GET /me/drive/items/{item-id}/content
    GET /shares/{shareIdOrEncodedSharingUrl}/driveItem/content
    GET /sites/{siteId}/drive/items/{item-id}/content
    GET /users/{userId}/drive/items/{item-id}/content
    Reference Documents link URL
    Or
    GET /_api/web/lists/getbytitle('YourListName')/items?$expand=AttachmentFiles
    
     
    If my answer helped resolve your issue, please consider marking it as solved to assist others facing the same problem. Additionally, giving it a like would be greatly appreciated and motivates us to keep helping
     
    Thank You
    Ravindra Jadhav
     
     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard