web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate Randomi...
Power Automate
Unanswered

Power Automate Randomization Shuffle

(0) ShareShare
ReportReport
Posted on by 34

Hello,

I need assistance in creating a build that can create a random picker to pull 5% of the data population. I've created these steps so far, with this expression under the compose action.

body('List_rows_present_in_a_table')?['value'][rand(1, length(body('List_rows_present_in_a_table')?['value']))]

 

However, this will only pick 1 random item from the list. How can I update it to choose 5% of the population?

 

tliwanag_0-1706540598522.png

 

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    This is not totally random, but maybe random enough.

    The idea is to add a property 'Sort' with a random number.

    Then sort by this number and take the first 5% items.

     

    Chriddle_0-1706550554419.png

    Select

    Just generates some objects

     

    Select 2

    Adds the Sort property

    Map:

     

     

    addProperty(
    	item(),
    	'Sort',
    	rand(0, 1000000000)
    )

     

     

    Use a high limit to reduce the probabilty of duplicates.

     

    Compose

    Sorts by the random numbers and takes the appropriate amount of items

     

     

    take(
    	sort(
    		body('Select_2'),
    		'Sort'
    	),
    	div(
    		length(body('Select_2')),
    		20
    	)
    )

     

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard