cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Megs_beach
Helper I
Helper I

Get completed planner task’s description and the user is for who completed it

I have a flow that starts when a planner task is completed. It finds the description and the assigned users and inputs that information in a SharePoint list. The problem is that the flow seems to pull the name(s) of whoever was assigned AND who completed the task. 

I'm looking for help with fixing the flow so that it either pulls only who was assigned at the time it was completed OR the user ID of whoever completed the task.

 

I’ve tried using compose with the expression: triggerBody()?[‘completedBy’]?[‘user’]?[‘id’] to find the user id for who completed the task, but keep getting a failed response. 

Any help that can be provided is greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions

@kdavis91 
thank you! I was able to fix the flow so it only puts 1 name in the column now. 😊

 

View solution in original post

11 REPLIES 11
Amanthaper
Responsive Resident
Responsive Resident

removed

v-bacao-msft
Community Support
Community Support

 

Hi @Megs_beach ,

 

You could use the expression to get Completed by user id and get the user profile:

triggerOutputs()?['body/completedBy/user/id']

114.PNG

 

Best Regards, 

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

@Amanthaper 

So my current flow will show who was assigned to the task, but it seems to also show anyone who was ever assigned to the task and the user id of who completed the task.

 

If possible, I need to limit this to ONLY the last person assigned or the person who completed the task, not all users.

 

@v-bacao-msft 

I attempted to use the expression you provided but got the same error message (copied below):

”The ‘inputs.parameters’ of workflow operation ‘Get_user_profile_(V2)’ of type ‘OpenApiConnection’ is not valid. Error details: The resolved string values for the following parameters are invalid, they may not be null or empty: ‘id’”

 

 

any other ideas?

removed

@Amanthaper, that may work. I am new to power automate and not familiar with the Parse JSON. Would you be able to provide more instruction on how to set up the flow? I tried to follow the picture, but I think I’m missing something.

 

thanks in advance for your help!

removed

Megs_beach
Helper I
Helper I

Thank you for sharing this information. I figured out how to adjust the expression to find the user id of the user who completed the task. 

My issue now is that it pulls the same user name multiple times when several tasks are completed at the same time. I have all concurrancies set at 1, but that does not seem to help. Any suggestions on how to keep it from pulling the name multiple times?

Can you please post some pics of your flow and planner tasks and what seems to be the issue? Something seems amiss. There should only be one completed user regardless of multiple people assigned to a task and if you're using the expression in an apply to each loop then you should only get back one result. Let's take a look at your flow.

@Amanthaper 

 I can’t do pics right now, but the flow runs like this:

 

1. when a planner task is completed

2. initialize variable for the user id

3. Apply to each:

    A. “Get task details” for the task completed

    B. “Compose” to get the description from the planner task

    C. “Get user profile (V2)” to get the if of you completed the task. This uses an expression of: item(‘Apply_to_each’)?[‘completedBy/user/id’]
     D. “Append to sting variable” for the display name

     E. “Get items” from a SharePoint list

     F. “Apply to each”/“Condition” - does the value in the Planner ID column on the SP list match the planner task id

    If yes:

      1. Update the SP list item with the display name of who completed the task and the description 

      2. Create a new SP item on a new SP list and copy the information from the item that was updated

      3. Delete the item from the first SP list. 

All of the concurrencies from top to bottom are set to 1. The problem I get is that when I complete multiple tasks at the same the column where it puts the name of who completed the task gets multiple names after the first task (I.e. the first take update gets only 1 name, the 2nd task updated gets 2 names, the 3rd gets 3 names and so on). The flow works great if you’re only completing 1 task at a time, but it’s more likely that several tasks will be completed at the same time.

kdavis91
Continued Contributor
Continued Contributor

@Megs_beach 

 

You need to set your String variable to null at the end of each loop.

 

Append just means "Add". So the first time through the loop, the value of the variable is null and gets "user1" added to it for a final value of "user1".

The second time through the loop, the value of the variable is "user1" and gets "user2" added to it for a final value of "user1user2".

if you set the string variable to null before it iterates through the loop again, that should solve this problem

 

please let me know if you have any questions.

 

thanks,

Kyle

@kdavis91 
thank you! I was able to fix the flow so it only puts 1 name in the column now. 😊

 

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (2,934)