I am trying to post a message in Teams to show that a specific task has been completed by the user who closed a Task in Planner. Does anyone know the variable I can use to accomplish this? Currently there is no content for user who completed a task.
Hi,
I have tried everything stated here by my flow still doesnt work. I always get error in the get user profile
I ran into this issue as well and used an expression to lookup the user so I could pull the display name in just a couple short steps. I wrote a step-by-step guide and recorded a video as well to help others:
Blog post step-by-step: https://natechamberlain.com/2022/02/17/how-to-get-planner-task-completed-by-dynamic-content-in-power...and
Video recording: https://youtu.be/fVnKKeyDryM
As the original user is no longer a part of this forum, would an admin be able to accept @HonzaUH's response as the solution?
It is exactly the solution for the problem presented.
thank you,
Kyle
It works perfect for me! Thank you.
Best regards,
Fabiano
@HonzaUH Of course this is it 🙂 Now it indeed "works like a charm". Many thanks to you and @Anonymous for taking the time to help another noob!
Hi @seanpcoa !
If I am correct, you are using multiple triggers in your Flow. It is most likely that 'triggerBody()' only works for the first trigger in the whole Flow. So you are basically trying to find this value triggerBody()?['completedBy']?['user']?['ID'] in a bad triggerBody. Of course it isn't there (well it is, but the path is diferent and the value is NULL), so hence goes the error. I can't think of a solution to this now, because I am quite busy, but you can definitely make it work if you only use one trigger action per Flow 🙂
Cheers and GL!
Adding a bit to this, when we use the expression triggerBody()?['createdBy']?['user']?['ID'] the flow works, and we get to the good bits in the user profile:
However, when we use the expression triggerBody()?['completedBy']?['user']?['ID'] the flow breaks and we get a 404 not found:
Both createdBy and completedBy contain valid user ID strings in the trigger body:
Any ideas or advice would be greatly appreciated!
@Kevin <facepalm> I've been so used to clicking into the field to add the expression I didn't even bother to check the obvious. Thanks for pointing that out! I'm still back at the original problem: the flow fails at Get user profile (V2) with 404 resource not found in the Body output. Pretty frustrating, it seems I must be missing something obvious here. In this flow, I've kept it as simple as possible for testing, but can't seem to extract the completedBy user ID in the Get user profile (V2) step:
Glad that it's working now!
Not sure why PA acts the way it does sometimes. Sometimes saving and leaving is what it takes! 😕
to see the expression, hover your cursor over the green box...
I think the reason it doesn't show up in the expression box is so that you can add another expression if you want to (though you'd think Microsoft could just add an option to add new or edit existing...).
to keep the expression in a place that you can readily see it and copy it if needed, you can add a comment to the action block (accessed in the options list at the top right of each action block) and type/paste the full expression there.
thanks,
Kyle
@Anonymous thank you for that tip! I saved, exited the flow, then went back to edit the flow. The field is now green as shown in @HonzaUH 's screenshots. Not sure why I would need to leave, then come back. However, I cannot see the code in the expression to verify it's still there:
ankit_singhal
5
Super User 2025 Season 1
David_MA
2
Super User 2025 Season 1
Mitchell GC
2