I have a task list, for an example:
task1 - assigned to user1
task2 - assigned to user1
task3 - assigned to user2
task4 - assigned to user2
task5 - assigned to user1
How can I create a flow which will filter all tasks with dues date today and send individual emails to users to whom tasks are assigned to?
I have created a flow which just filter all tasks with due date today, make an HTML-table and send in to one email.
But I cann't split emails to send to users the information only about their tasks (where the user is in the fiels Assigned To).
Could you help please?
Let me first make sure I understand your problem correctly: you have a table containing list of tasks and for each task, the user it is assigned to & their email. Right? Now you want to send each user the tasks they are assigned to and which are due today.
0. First (as you did) use a "data operation filter array" action to keep only the due items. Let's call this output the "DueTable".
1. The first possibility is to loop over the DueTable with an "apply to each" loop and send an email for each item found.
Pro: it is easy to build.
Con: in your example, user1 will get 3 emails and user2 will get 2 emails.
2. The more correct but also more complicated version of this, is to first perform a "distinct" filtering on your DueTable to get all the different users that are supposed to get an email and then filter the DueTable per user again before sending them digest emails.
The tricky operation is the "distinct" since there is no function to do this that I know of. The workaround is to do it yourself. That means looping over the table once and adding all the users to a UserTable.
I would do something like this:
Note the "value" parameter of the apply to each DueItem here is special to my test, it should be the "DueTable" for you.
At the end of this workflow, the UserArray should contain [User1, User2].
Finally, iterate over this UserArray, Filter the DueToday items per user, construct an HTML table with the output and send it away!
Does this makes sense?
I think that is what I'm looking for! Thank you!
I'm working with the list of tasks on the SharePoint site, but think it is a minor difference (as I understand you are working with Excel on this example)
Could you please provide more details how to set up actions (I marked it on the screenshort)? Could you please open it and show? 🙂
I didn't implement any of those, the picture is purely theoretical. But they should be straightforward. Did you try?
To get today's date, you can use something like:
And then place this as the second value of your "is equal to" comparison filter... something like this:
The other filter arrays work similarly. Put the variable you are iterating with on the left, and the comparison variable on the right.
And the array variable initialization and appending are straightforward.
Please try it and tell us exactly where it is not working...
Thank you for posting on the Flow Community Forum! It appears as though @TimBourguignon would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!
Thank you for being an active member of the Flow Community!
Flow Community Manager
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
Check out the community blog page where you can find valuable learning material from community and product team members!