The flow/PowerAutomate is as follows
PowerAutomateFlow
For Each Tasks
The reason to extract user profile/email from user ID is to create Metrics. Also, when trigger 'When new tasks is created' is used, it easy to extract the user profile from valueassignment but the use case, we can only use ListTasks as trigger can be manual.
Although below reference shares how to extract, extracting required part within a loop from JSON has become tricky. Please help us. Reference: https://powerusers.microsoft.com/t5/Building-Flows/Exporting-the-Assigned-To-user-ID-from-Planner/td-p/177310 https://powerusers.microsoft.com/t5/Building-Power-Apps/Listing-tasks-ASSIGNED-TO-a-certain-user-from-Planner-in/m-p/1783631#M452392
Reference: https://powerusers.microsoft.com/t5/Building-Flows/Exporting-the-Assigned-To-user-ID-from-Planner/td-p/177310 https://powerusers.microsoft.com/t5/Building-Power-Apps/Listing-tasks-ASSIGNED-TO-a-certain-user-from-Planner-in/m-p/1783631#M452392
Basically, to grab user ID from the Tasks step
User profile left unchanged: items('ForEachTasks')?['Assignments']?[0]?['userId']
Since '_assignments'
is an array you will need to target the first one. Try something similar to:
items('ForEachTasks')?['Assignments']?[0]?['userId']