Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Create an array of lowest values, from an array of values.

(0) ShareShare
ReportReport
Posted on by 12

I'm working on a flow that gets a random item from Excel, based on a weight value. After that random item is found, the weight would increase by 1, so as to not be picked again, until all other items have been picked.

I have a working flow that for now, does all of this methodically in order (Item 1, then Item 2, then Item 3, etc...)

I'm trying to figure out how to build a new array of "lowest weights" from my array of "weights".

Currently, my array of weights looks like this:

 

[
 3,
 4,
 2,
 4,
 3,
 2,
 4,
 2,
 3,
 3
]

 

With this array, you can see there are 3 items with weight "2". I want to gather all items with weight "2" and make a new array of these items.

 

[
 2,
 2,
 2
]

 

From here, hopefully I'll be able to reference the correct line item to pull a random item from this new "sub array".

I'm not sure exactly how to do this however, and was hoping for some guidance.

 

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