Skip to main content

Notifications

Community site session details

Community site session details

Session Id : plVx0MGCi5Mu0vWYxcZ6kN
Power Automate - Building Flows
Unanswered

Split array into multiple equal divided arrays

Like (0) ShareShare
ReportReport
Posted on 24 Mar 2021 15:31:45 by 79

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!

 
 
 
 
  • BenVdP Profile Picture
    79 on 26 Mar 2021 at 09:22:40
    Re: Split array into multiple equal divided arrays

    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

  • Paulie78 Profile Picture
    8,407 Super User 2025 Season 1 on 24 Mar 2021 at 16:51:42
    Re: Split array into multiple equal divided arrays

    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?

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started