Skip to main content

Notifications

Community site session details

Community site session details

Session Id : ehOx5Jczd8TZ8Jy5ZB9UJr
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,641 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 🌸

WIN Power Platform Community Conference 2025 tickets!

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,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard
Loading started