I have a list in SharePoint online where I want to filter on several columns and then select a specific number of random items that meet the filter criteria. Is this possible?
For example, I may have 3000 items in my list, but I want to choose some from the ones who have Status = Approved and School = Central High School. After I filter on the Status and School columns, I may have 75 list items. From those items, I need to define the number to be selected (let’s say in this case it was 50), and I’d like SharePoint to do a random selection of 50 items (from the 75 who met the filter criteria, out of the 3000 in the list). Ideally, I’d then like to use Flow to change the Status value for those list items, to change them from Approved to Placed.
I have a list where I’ll need to make multiple draws, where there may be 7-10 fields used to filter the list first.
My first thought was to do something manually (filter the list items, then have a “DrawNumber” column where I could assign each item a sequential number, then use a standalone RNG to pull from those numbers before manually reconciling the SharePoint list items to the RNG selections), but it will be time-consuming, so if I can automate it I’d prefer that.
If needed, I could create a view for each permutation and build some kind of flow around that, but what I’d love to do is be able to dynamically filter my results in the browser, choose the number of items to be picked, apply my “picker”, and then apply a flow to those items.
Another alternative that wouldn’t be too bad would be to generate the set of numbers in a standalone RNG if I could somehow paste them in (or otherwise access them) for the DrawNumber column filter.
So I could go to https://numbergenerator.org/ and set it to pull 50 numbers between 1 and 75, and then open that set of numbers in Excel:
But then, in my SharePoint list, the only way I see to choose the filter values is to click on each individual box (this screenshot shows ID, but I’d want to use my DrawNumber column):
Even if I create a view and try to paste in the numbers for the filter value, it only seems to accept a single number at a time (not a set of comma or space-delimited numbers). If I enter “1 2”, I get an error telling me that’s not a number. If I enter “1,2”, like this…
… it removes the comma and treats it like “12”.
Any suggestions on how to streamline this process?