Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

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



I am creating a flow to get all the item assined to a single user and send an email to that user with all the item detail .


I dont want to send separate email for each task .


Could you please help me with any option . 




133 REPLIES 133




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?




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?

Not applicable

@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: 

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


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



3. Send an email action: Change TO formula to 

4. Last two actions need to be updated, Compose and Set variable. In the compose action after send an email, use following: 
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.

@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.

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


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


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


@Anonymous - 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.

Not applicable

@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.

Awesome! Glad it worked for you! @DanFFSLA 


@Anonymous 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!

New Member

Hi All,


It worked for me,only need to add 

a set variable AssignedToEmailArray form first compose Output.


Not applicable

@ZachRoberts need your help on one of the questions I posted, please answer if u know the solution:

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

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.





I tried all the above options but could not fix the below error:


Unable to process template language expressions for action 'Apply_to_each' at line '1' and column '2032': 'The template language function 'first' expects its parameter be an array or a string. The provided value is of type 'Null'. Please see for usage details.'.


Any other options:


@ZachRoberts@gautmish  Thank you!

Not applicable

@BB9, please share screenshot of flow

Hi @BB9 ,


As @Anonymous mentioned can you please share some screenshots so we can help you out better? 


From the error message you are getting your flow is expecting to receive a string or array but it is getting a null value? Is the column you are getting from SharePoint empty? 




Thank you.


Attached are the screenshots. The Sharepoint list has four columns and every column has data. Let me know if you need any additional information.



Thanks for the info. 


Now I am just assuming here but is the screenshot of your list with the test data in it the one you are using or was setup as an example? My question here is are you using the 'People' column for your "Assigned To" field?


My Assigned To field is setup as below



@ZachRoberts Thanks for the response. Yes, that is correct. I am getting the error with the same data. The 'AssignedTo' column has the same properties as yours. Also, all the other columns are removed from the list except these four which we see in my screenshot.

@BB9 Can you send screen shots of the errors you get when you are testing your flow? It might be helpful to see at what step your flow is breaking, can you also expand the other formulas you have entered in your flow?



@ZachRoberts  Here it is.

Flow Error.png1.pngfirst(item()?['AssignedTo'])?['Email']     iseual to        first(variables('BBEmailArray'))first(item()?['AssignedTo'])?['Email'] iseual to first(variables('BBEmailArray'))3.png4.png

Hi @BB9 


I think i see the issue. on your first apply you need to gather the email addresses and add them to your array like the below screenshot from my flow. v4WTQDLTyJ.png


In your screenshot below you are missing this step. So you need to add append to array variable and make sure the apply to each output is set to the value you get from the get items.





Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,119)