cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Flow to filter distinct people picker emails for reminders

Hi,

 

I am using the SharePoint OOTB Task List for one of the implementations where I have Task name, description, due date(renamed to completion date), assigned to (renamed to Resposible Party), below is a screenshot for same.

 

Capture.PNG

 

I want to create a flow that runs every day at 8 am, runs and gets tasks from this list for which due date is today so i guess that would be by get items action. Now as you see in the screenshot attached, considering todays' date, below would be fetched from SharePoint as a result of get items action.

Capture3.PNG 

Then I would like to send an email out to Maddie and Robert letting them know that 'You have a task due please check sharepoint'.

However, if I add send an email, both maddie and robert would receive two emails each. So post get items, I would like to store distinct emails in a variable and then use that in send an email action so they only receive one email each.

 

Email body is pretty simple "You have a task due today, please chec in sharepoint" so nothing dyanmic as far as email body is concerned. Can someone please help me getting distinct emails for responsible party using variable or something and eventually using it in send an email.

 

Thanks in advance. 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

I was able to get this to work, turned out that variables and apply to each are your best friends when it comes to flow 😀, please see screenshots below of the flow, hope it helps someone!

Flow1.JPGFlow2.JPGFlow3.JPGFlow4.JPGFlow5.JPGFlow6.JPGFlow7.JPGFlow8.JPGFlow9.JPGFlow10.JPGFlow11.JPG

View solution in original post

5 REPLIES 5
RezaDorrani
Dual Super User
Dual Super User

Hi @Anonymous 

 

You would need to use expressions to achieve most of this

 

I have a sample scenario in which I retrieve data from a SP list, group the data based on a category and send emails for each category

Feel free to customize the below Flow for your needs

https://github.com/rdorrani/Microsoft-Flow/blob/master/SharePointfilescategorizebyCustomerandsendemail_20190926003902.zip

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Anonymous
Not applicable

Thanks @RezaDorrani , I used array variable and I am able to get unique emails in array but using it in send an email is now a pain, in send an email action , I used variables('Emails') expression to send emails out but seeing below in failed action

Capture.JPG

Of course, its coming in array form so send an email is failing, any thoughts how I can fix this? Below is output of my set variable

Capture2.JPG

Hi @Anonymous,

 

You can create a String variable to accept the Email, convert Email array into a plain text, for example:

 

Annotation 2019-10-24 170401.png

Annotation 2019-10-24 170344.pngAfter that, you can put the EmailPlain into the Email field.

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

Anonymous
Not applicable

I was able to get this to work, turned out that variables and apply to each are your best friends when it comes to flow 😀, please see screenshots below of the flow, hope it helps someone!

Flow1.JPGFlow2.JPGFlow3.JPGFlow4.JPGFlow5.JPGFlow6.JPGFlow7.JPGFlow8.JPGFlow9.JPGFlow10.JPGFlow11.JPG

Anonymous
Not applicable

flow seems to work for me but it gives time out error for my SharePoint list.

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,716)