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

Re: microsoft flow get all items with distinct Assigned to (User and group) filed

@DanFFSLA 

 

Hi! 

It looks like you are running into the issue I did when following the instructions for this flow where each email would receive an email for every task. On the first page in this thread my posts layout the issue and then i have one going over my complete setup in flow, have you tried the settings from those?

 

 

Thanks,
Zach

DanFFSLA
Level: Powered On

Re: microsoft flow get all items with distinct Assigned to (User and group) filed

I read it and it sounded to me like you were getting an email for each item. My emails contain a list of multiple items (as intended) but emails themselves are being send multiple times. So if I have two items on the list, I will receive two emails that each contain both items.  Do you think your solution would work for my issue too?

dmistry
Level 8

Re: microsoft flow get all items with distinct Assigned to (User and group) filed

@DanFFSLA  you are not using DistinctEmailArray and compose needs to be removed, See my screenshots below:

 

1. Initialize variable called 'DistinctEmailArrray' of type array. In the value, use following: 

union(variables('AssignedToEmailArray'),variables('AssignedToEmailArray'))
 
Also change the formula inside Do until to "@empty(variables('DistinctEmailArray'))"

First.JPG

2. Inside your filter array action , change existing expression on the right side of equal to to "

first(variables('DistinctEmailArray'))

"

3. Send an email action: Change TO formula to 

first(variables('DistinctEmailArray'))
 
4. Last two actions need to be updated, Compose and Set variable. In the compose action after send an email, use following: 
skip(variables('DistinctEmailArray'),1)
 
For set variable change variable to set to DistinctEmailArray, make sure the value is set to 'Output' from above compose step.
 
Your flow should work then.
ZachRoberts
Level: Powered On

Re: microsoft flow get all items with distinct Assigned to (User and group) filed

@DanFFSLA yes I was getting an multiple emails for each item which would contain all of the items (it would just iterate through the number of items) but in my next response I solved what the issue is with the orginal post. Please see my two replies.

 

https://powerusers.microsoft.com/t5/General-Flow-Discussion/microsoft-flow-get-all-items-with-distin...

(Link above doesn't jump to message but it is message 13 in this thread)

 

https://powerusers.microsoft.com/t5/General-Flow-Discussion/microsoft-flow-get-all-items-with-distin...

 

Also it looks like @dmistry is pointing out the issue that would of been found in my post as well Smiley Happy

 

DanFFSLA
Level: Powered On

Re: microsoft flow get all items with distinct Assigned to (User and group) filed

Thank you, Thank you! I was ready to give up on this flow and you guys gave invaluable help.

 

@dmistry - Thank you much! It all worked as you predicted!

@ZachRoberts  - Thank you for taking the time to provide your advice. Since I read dmistry's comment first, I followed his steps.

dmistry
Level 8

Re: microsoft flow get all items with distinct Assigned to (User and group) filed

@DanFFSLA  I was in the same position as yours, lol. I have been in situations where I would have given up on many flows that I had started working on but the flow community is always there to help us so never lost hope and thanks to Microsoft for setting up a platform like this. Many thanks to @ZachRoberts  for his work on the revised solution. Cheers, good to hear that it helped you @DanFFSLA.

ZachRoberts
Level: Powered On

Re: microsoft flow get all items with distinct Assigned to (User and group) filed

Awesome! Glad it worked for you! @DanFFSLA 

 

@dmistry thanks! 

 

I agree this community is very helpful and Flow/Powerapps would of been challenging without this platform to reach out for help! 

 

Best of luck to both of you!

JyoBhai
Level: Power Up

Re: microsoft flow get all items with distinct Assigned to (User and group) filed

Hi All,

 

It worked for me,only need to add 

a set variable AssignedToEmailArray form first compose Output.

 

dmistry
Level 8

Re: microsoft flow get all items with distinct Assigned to (User and group) filed

@ZachRoberts need your help on one of the questions I posted, please answer if u know the solution: https://powerusers.microsoft.com/t5/Building-Flows/Need-help-on-the-flow-expression-for-due-date/m-p...
Highlighted
wi11iamr
Level: Powered On

Re: microsoft flow get all items with distinct Assigned to (User and group) filed

Thanks @dmistry, after much struggling, the solution was merely to modify my Sharepoint List such that my Person/Group field allowed multiple values.

ZachRoberts
Level: Powered On

Re: microsoft flow get all items with distinct Assigned to (User and group) filed

Hi Everyone,

 

Since it looked like alot of people are stumbling across this forum post I did a write up on how to set this up and to get it to work on my website check it out if you would like.

 

https://spodev.com/task-reminders-microsoft-flow-and-sharepoint/

 

Thanks,
Zach

>