Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Optimize "apply for each"

(0) ShareShare
ReportReport
Posted on by 23

I have a quite a heavy flow that i would like to optimize if possible.  My question is weather its possible to speed up the apply for each function?

Basically what happens is that i have value x from a column in a document library. I then asks it to match value x with value Y in another documentlibrary and Value x and Value Y are both unique in their libraries.. Then i ask it to preform certain actions. It works great, but takes forever. 


I come from the SQL world so for me this is action should be fast, but its not... I get a feeling it goes through and fail on all actions where there is no match, rather then retrieve a list of matches and then apply, if you get what i mean.

The flow currently looks like this: psflow.png

  • AnnicaTunster Profile Picture
    23 on at
    Re: Optimize "apply for each"

    Worked like a charm! Many thanks.

  • AnnicaTunster Profile Picture
    23 on at
    Re: Optimize "apply for each"

    Thank you! i thought that might be the case 🙂 I was looking into putting some kind of odata filter in the get file properties but couldnt figure out how to do it. I will do some research on how to use filter arrays, i might come back with a question if i cant sort it 🙂 Thanks!

  • Verified answer
    SCTdan Profile Picture
    604 on at
    Re: Optimize "apply for each"

    If I'm understanding what you're trying to do correctly, you should be able to speed this up using Filter Array.

     

     

    If x and y are unique, this should just spit out your single record.  

     

     

    @AnnicaTunster wrote:


    I come from the SQL world so for me this is action should be fast, but its not... I get a feeling it goes through and fail on all actions where there is no match, rather then retrieve a list of matches and then apply, if you get what i mean

     

     

    That's exactly what it does.  Definitely want to present Apply to Each with the smallest dataset possible.

     

     

    Thanks

    dan

     

    If you have found my post helpful, please mark thumbs up.

    If this post has solved your problem, please click "Accept as Solution".

    Any other questions, just ask.

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492