“I’d like to receive an information about a completed Planner task, but Power Automate doesn’t tell me which user completed it!”
If you use the ‘When a task is completed’ Planner trigger, you’ll get a lot of dynamic contents. You get the author, the assigned user, the creation, start, due and completed date, but there’s no information who completed the task. The ‘Completed By’ dynamic content is just not there. Yet it’s still possible to get the information, and this post will show you how.
Extract it from the trigger output JSON
As already explained in the post on parsing JSON, dynamic contents only simplify your work. Power Automate will process the output from an action, and offer you the values it recognises as dynamic contents. If something is missing among the dynamic contents, it doesn’t mean that the information isn’t there. It just wasn’t offered directly.
Take the output from the trigger action, and place it in a text editor (I prefer Visual Studio Code). You’ll see that it contains the ‘completedBy’ property.
The information is there, you just need to extract it. The displayName will be empty, but there’s also the user id to identify the user. Take the user id using an expression.
Once you have the user id you can use it to search for the additional user information. Add the ‘Get user profile (V2)’ action, use the expression as the input, and take the information you need.
If you’re looking for something specific and you don’t see it among the dynamic contents, try to check the JSON output. As you can see in this post, even though Power Automate doesn’t offer directly the user who completed the Planner task, you can still extract it from the JSON. It’ll be only the user id as that’s what Planner gives you, but once you have it it’s easy to find the other user information.