Skip to main content

Notifications

Community site session details

Community site session details

Session Id : yst/3BzEnbO0///fN1C3Bl
Power Automate - Building Flows
Unanswered

How can I rand(1,40) only unique numbers, without repeating?

Like (0) ShareShare
ReportReport
Posted on 7 Apr 2022 09:47:21 by 520

I want to get 40 random items from a sharepoint list based on their ID, but I don`t want them to repeat.

  • Expiscornovus Profile Picture
    31,701 Most Valuable Professional on 07 Apr 2022 at 10:52:16
    Re: How can I rand(1,40) only unique numbers, without repeating?

    Hi @Robert94,

     

    One approach could be to interact with a service like random.org and just collect such a set of unique numbers from there. This way you do not have to do this calculation in Power Automate.

     

    After that you could use the array to retrieve the SharePoint list items with for example an apply to each loop and a get item action.

     

    Below is an example of getting an array with 40 unique numbers in random order:

    This hyperlink generates 40 unique numbers in plain text format.

    https://www.random.org/integer-sets/?sets=1&num=40&min=1&max=40&seqnos=on&commas=on&order=index&format=plain&rnd=new

     

    split(trim(replace(body('HTTP'), 'Set 1: ', '')), ', ')

     

    randomorg_items.png

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 125

#2
David_MA Profile Picture

David_MA 109 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 90 Super User 2025 Season 1

Overall leaderboard
Loading started