How to extract user profile from Planner (List tasks)?

199 Views Asked by At

The flow/PowerAutomate is as follows

PowerAutomateFlow

enter image description here

  1. Choose the GroupID and PlanID from Workspaces for List Task step
  2. Get plan details: PlanID = first(outputs('List_tasks')?['body/value'])?['planId']
  3. Tasks: From = outputs('List_tasks')?['body/value'] Map: Assignments = items()?['_assignments']

For Each Tasks

enter image description here

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

Update

Basically, to grab user ID from the Tasks step

Snapshot of Raw output of Tasks

Update about concatenating users for each task

User profile left unchanged: items('ForEachTasks')?['Assignments']?[0]?['userId']

Update

1

There are 1 best solutions below

9
Sam Nseir On BEST ANSWER

Since '_assignments' is an array you will need to target the first one. Try something similar to:

items('ForEachTasks')?['Assignments']?[0]?['userId']