cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RedAl
Advocate I
Advocate I

Shuffle Function with a timed exclusion

Hi, I`m part way through designing and app that uses the shuffle function to choose a random item from a sharepoint list containing factories. It then chooses up to 6 workers from that factory. This part works absolutely fine but I couldnt find anything online to give me help on making sure the previously chosen factory can`t be selected for a set time period.

 

Can anyone give me some guidance? 

3 REPLIES 3
v-monli-msft
Community Support
Community Support

Hi @RedAl,

 

First of all, please understand that Shuffle returns a table that has the same columns and number of rows as the argument. So I'm not sure what do you mean by "choose a random item from a sharepoint list containing factories." Please explain this part maybe with the related formula. 

 

About your requirement, I think it is that you want to filter the SharePoint list with a set time period. I assume that you have one date column in this SharePoint list and want to filter base on this column. Let's call it "Date" for example. You can insert 2 date picker controls to select the date range. DatePicker1 and DatePicker2 are the date picker controls' names. Then you could set a formula like below to get what you want:

Shuffle(Filter(ListName, Date>DatePicker1.SelectedDate,Date<DatePicker2.SelectedDate))

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, sorry, I didnt explain the setup well. I`m using the shuffle function to shuffle the list of factories taken from the Sharepoint List then going with the Factory at the top of the list. It then applies the same logic for the top 6 factory workers. Then I have the "send email" button that mails the six chosen workers and also outputs the factory, workers etc into a second sharepoint list which does have a date column. Am I right in thinking I can use that output sharepoint list with the datepicker command?

Thanks Mona

Hi, further to my previous message. The original sharepoint list has no date column. As this sharepoint list is going to be automatically overwritten daily with updated source data I can`t automate the addition of a date column. I wondered if it was possible to add a date column to my collection but am struggling to find anything online for this exact query. Is it even possible?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (894)