cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Optimize "apply for each"

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Responsive Resident
Responsive Resident

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.

 

View solution in original post

3 REPLIES 3
Highlighted
Responsive Resident
Responsive Resident

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.

 

View solution in original post

Highlighted
Frequent Visitor

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!

Highlighted
Frequent Visitor

Re: Optimize "apply for each"

Worked like a charm! Many thanks.

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (6,613)