cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anabananei
Level: Powered On

Send Email to random users

Hello Everyone,

 

Anyone can help me on my problem?

When an item is created, a survey will be sent out to random users from my team. I have 17 people on my team and the survey should only be sent to 5 random people every time a new item is created. The 5 selected people should not be the same as the previous days. Is this possible in Flow?

 

Many thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Send Email to random users

Hi @anabananei ,

 

Yes, this problem has been mentioned in my previous post, because the range of values is relatively small, so rand() function may get the same value.

And I use union() function to remove duplicate values, so you don't necessarily pick up five users.

I have improved it, please refer to the screenshot below for improvement.

 

Expression:

length(union(variables('Email'),variables('Email')))

10.PNG

 

11.PNG

 

Please take a try.

 

Best Regards,

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

Re: Send Email to random users

Hi @anabananei ,

 

What is currently achievable is to randomly extract five users, but there is no guarantee that these five people will not be duplicated, because Rand() function may get the same result in a small range.

What's hard to achieve is that the second time the user to be sent, the previous user needs to be excluded.

Because it is necessary to record the previous personnel, how to obtain it when the next execution of Flow is a difficult point.

 

Anyway, I created a flow that randomly selects five users, you could use it as a reference.

Create a list to record the user information, create a new Person type column to select user, and give each user a number, you could consider directly using ID as a number.

42.PNG

Flow configuration:43.PNG

 

44.PNG

 

45.PNG

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
anabananei
Level: Powered On

Re: Send Email to random users

Hi @v-bacao-msft ,

 

I have tried your flow and it works. The only problem is that instead of 5 results it only gives me 4. I mirrored your flow exactly. What do you think seems the problem?

 

Thank you,

ANa

Highlighted
anabananei
Level: Powered On

Re: Send Email to random users

I tried changing the value of "minimum value" in random expression from 1 to 5 and it gave me 5 results. Do you think this is the correct workaround?

Flow_random.jpg

 

Community Support Team
Community Support Team

Re: Send Email to random users

Hi @anabananei ,

 

Yes, this problem has been mentioned in my previous post, because the range of values is relatively small, so rand() function may get the same value.

And I use union() function to remove duplicate values, so you don't necessarily pick up five users.

I have improved it, please refer to the screenshot below for improvement.

 

Expression:

length(union(variables('Email'),variables('Email')))

10.PNG

 

11.PNG

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
anabananei
Level: Powered On

Re: Send Email to random users

Works perfect! THank you!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 151 members 4,390 guests
Please welcome our newest community members: