Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

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

Posted on by 76
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?
  • abc 123 Profile Picture
    abc 123 629 on at
    How can it be shorter? Flow goes through far too many attachments to choose from
    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?
     
     
     
     
  • Suggested answer
    Pstork1 Profile Picture
    Pstork1 64,014 on at
    How can it be shorter? Flow goes through far too many attachments to choose from
    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.

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard