web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get completed planner ...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on by 37

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!

Categories:
I have the same question (0)
  • Amanthaper Profile Picture
    441 on at

    removed

  • v-bacao-msft Profile Picture
    on at

     

    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, 

  • Megs_beach Profile Picture
    37 on at

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

  • Amanthaper Profile Picture
    441 on at

    removed

  • Megs_beach Profile Picture
    37 on at

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

  • Amanthaper Profile Picture
    441 on at

    removed

  • Megs_beach Profile Picture
    37 on at

    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?

  • Amanthaper Profile Picture
    441 on at

    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.

  • Megs_beach Profile Picture
    37 on at

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

  • Community Power Platform Member Profile Picture
    on at

    @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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard