cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ramsabi
Helper II
Helper II

Send an Email when a task in Planner is marked complete

I have written a flow that mails the manager whe a task is complete. I have included the Task Title, Completed By, and Completed Date Time. Please see the flow below. It works perfectly.

 

Planner email flow.jpg

 


I am now trying to add the person/s (there could be more than one) to whom the task was assigned (because they could be different from the person who marked the task complete), but I am unable to figure out how.
Can someone help please?

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @ramsabi,

 

You could use the assignments collection from the trigger action to retrieved the assigned persons. However, this collection doesn't contain an e-mail. So, you would need an additional apply to each to loop through the ids and retrieve their e-mail addresses from Azure AD. 

 

Below is an example of that approach.

 

assignedtomail.png

 

1. Add an initialize variable after the Get User Profile (V2) action. Call it AssignedToMail and set the type to string.

 

2. Add a select. Use the assignments in the from. Use the UserId field in the Map.

 

item()?['userId']

 

 

3. Add an apply to each. Use the output in from the select.

 

4. Add a Get User within the Apply to each. Use the item() as the value.

 

5. Add an Append to String variable. Use the mail dynamic content field. Don't forget to add the ; at the end.

 

6. Use the AssignedToMail in your Send an email action (which should be outside the apply to each).

View solution in original post

1 REPLY 1
Expiscornovus
Super User
Super User

Hi @ramsabi,

 

You could use the assignments collection from the trigger action to retrieved the assigned persons. However, this collection doesn't contain an e-mail. So, you would need an additional apply to each to loop through the ids and retrieve their e-mail addresses from Azure AD. 

 

Below is an example of that approach.

 

assignedtomail.png

 

1. Add an initialize variable after the Get User Profile (V2) action. Call it AssignedToMail and set the type to string.

 

2. Add a select. Use the assignments in the from. Use the UserId field in the Map.

 

item()?['userId']

 

 

3. Add an apply to each. Use the output in from the select.

 

4. Add a Get User within the Apply to each. Use the item() as the value.

 

5. Add an Append to String variable. Use the mail dynamic content field. Don't forget to add the ; at the end.

 

6. Use the AssignedToMail in your Send an email action (which should be outside the apply to each).

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,105)