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 / How can it be shorter?...
Power Automate
Suggested Answer

How can it be shorter? Flow goes through far too many attachments to choose from

(0) ShareShare
ReportReport
Posted on by 90
How can it be shorter? Flow goes through far too many attachments to choose from.
 
The flow below sends a preparation assignment to the student 14 days before the start of the exam.
The Excel is first filtered (Filter Query in List rows) on exam date + 15 days.
Then it is filtered (Control) in the Apply to each on whether an Attachment is present (and therefore an email must be sent)

Then in the next Apply to each it is searched for the correct Attachment (Names are compared in Excel and File name in SharePoint).

The latter causes a problem: at the moment the folder only contains 22 Attachments, but that will eventually become about 150.
 
Can this be done more effectively and therefore faster?
Categories:
  • Suggested answer
    Pstork1 Profile Picture
    69,665 Most Valuable Professional on at
    Two Suggestions on ways to speed it up
     
    1) Wherever possible replace the Apply to Each with a Filter Array and a Loop on the result.  Since the first action in the Apply to Each is a Condition you can significantly decrease the number of Loops if you use Filter array to get just the records you need to loop through rather than testing each record.
     
    2) Where that isn't possible replace the Apply to Each with a Do Until and let it loop until you find the record you need then exit the loop. You can't break out of an Apply to each. You can stop a Do Until.
  • abc 123 Profile Picture
    789 Moderator on at
    A Flow can be triggered when a file is added to a Document Library(DL). So, when the file is added to the DL, can you check against the Excel data, and then send the email instead of a recurrence?
     
     
     
     

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 389

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard