cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenVdP
Helper I
Helper I

Split array into multiple equal divided arrays

Hope one can help me out here.

 

Current situation: I collect SharePoint list items using a SharePoint HTTP request action and returns around 3000 items. All those items are updated based on several conditions, which is causing the current flow to run more than 2 to 3 hours daily.

 

To be situation; I want to split the total items returned in x-number of equal divided arrays and process them simultaneously. For example, I have 3000 items and want to have them processed in 5 simultaneous threads of each 600 items. Where thread 1 holds the first 600, thread 2 the next 600, and so on...

 

As a starting point I used the solution of Paul Murana on this blog post, which is quite close to what I want to achieve. When I adjust it to the list and queries, I want to use, the items in the different threads are far from equal. One holds 500 items while the other holds 1700 items.

 

If more info is required, please reach out!

 
 
 
 
2 REPLIES 2
Paulie78
Super User
Super User

I wrote that article 😃

You could use the skip and take methods to create a different approach. So it would be like this:

 

First section: take(arrayname, 600)

Second section: take(skip(arrayname, 600), 600)

Third: take(skip(arrayname, 1200), 600)

and so on

 

This would remove the guessing tactic that I used in that blog post. Does that make sense?

Hi @Paulie78 ,

 

Actually, it does! The only thing is now, can I get this to work in a dynamic way? Currently I have a for each action for each thread. But ideally I would like to have it in such a way as the 'Each thread' action in your solution. Is that possible?

 

ConcurrentThreads.png

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,228)