Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Improve our power automate work flow which get called from power apps to return a list of planner tasks assigned to a specfic user and have a specific progress status

(0) ShareShare
ReportReport
Posted on by 1,542 Super User 2024 Season 1

I have a workflow which get called from power apps, the workflow accept 2 parameters, as follow:-

 

1) UserEmail

2) Progress Status

 

johnjohnPter_0-1717973132615.png

 

then i want to return the tasks from all the Groups and Plans which are assigned to the user passed from power apps and has its progress status = the passed status from the power apps. currently i have these steps:-

 

1) Get the UserID for the passed userEmail

2) Initialize and array parameter to store all the related tasks:-

 

johnjohnPter_1-1717973292271.png

 

3) get all the Teams, where i am storing the Teams names inside a sharepoint list

4) get all the Office 365 groups

 

johnjohnPter_2-1717973344942.png

 

 

5) Loop through the teams and check if the Team name is inside the Groups:-

 

johnjohnPter_3-1717973427595.png

 

6) if so, i get all the plans owned by a group

7) list all the Tasks for the plans

 

johnjohnPter_4-1717973494836.png

 

😎 then for the tasks i am looping through the "_assignment" array to check if the userId is inside the assignment array for a task >> if so i will add the task to the array, as follow:-

 

johnjohnPter_6-1717973681747.png

 

 

9) finally i am passing the Array back to power apps, by joining the array with ";" character, as follow:-

johnjohnPter_7-1717973744122.png

 

now i need to fix and do the following enhancements:-

 

1) currently i am looping through all the tasks for a Plan, and then i am checking if the user ID is inside the _assignment array for the task.. this is inefficient, so is there a way to filter the Plan tasks by the assignment instead? so i will only get the related tasks, instead of getting all the tasks and do the filtering on the power apps itself?

 

2) i am unable to filter nor to check the Task's Progress status... i tried to get the details for each task but the returned info does not contain the info for the task Progress column.. this is the Progress column i am talking about:-

 

johnjohnPter_8-1717973931126.png

 

 

3) to return back the tasks, i am joining the Tasks array using the ";" character. but how i can read those tasks inside power apps? i mean if a task info contain ";" characters then the logic will break, so what is the best way to return the array of tasks back to power apps? i am planning to have a gallery showing the related tasks inside our power apps canvas application

can anyone advice on the above 3 points please?

  • David_MA Profile Picture
    10,523 Super User 2025 Season 1 on at
    Re: Improve our power automate work flow which get called from power apps to return a list of planner tasks assigned to a specfic user and have a specific progress status

    Yeah, that's a bit complicated. You can greatly simplify things by sending an HTTP request to the graph API to return all Planner tasks for the user that triggers the flow. Just use this action:

    David_MA_0-1719851474523.png

    It uses this for the URI value:

    https://graph.microsoft.com/v1.0/me/planner/tasks?$filter=percentComplete lt 100

    The above gets all tasks that are not completed (less than 100%). To get not started you would want to check when it is equal to 0 and to get completed ones you would check when it equals 100. You can use a Parse JSON action to get the data out of the array, which returns these values:

    {
     "@odata.etag": "W/\"xxxxxxxxxxxxxxxxxxxxxxxxxx"",
     "planId": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
     "bucketId": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
     "title": "xxxxxxxxxxxxxxxxxxxxxxxxxxw",
     "orderHint": "8586060836358729344P_",
     "assigneePriority": "8586060835758573145",
     "percentComplete": 100,
     "startDateTime": "2020-08-21T10:00:00Z",
     "createdDateTime": "2020-07-23T16:55:09.6202662Z",
     "dueDateTime": "2020-08-28T10:00:00Z",
     "hasDescription": true,
     "previewType": "checklist",
     "completedDateTime": "2020-08-27T12:49:29.3199436Z",
     "referenceCount": 0,
     "checklistItemCount": 5,
     "activeChecklistItemCount": 0,
     "conversationThreadId": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
     "priority": 5,
     "id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
     "createdBy": {
     "user": {
     "displayName": null,
     "id": "xxxxxxxxxxxxxxxxxxxxxxxxxx"
     }
     },
     "completedBy": {
     "user": {
     "displayName": null,
     "id": "xxxxxxxxxxxxxxxxxxxxxxx"
     }
     },
     "appliedCategories": {
     "category4": true
     },
     "assignments": {
     "xxxxxxxxxxxxxxxxxxxx": {
     "@odata.type": "#microsoft.graph.plannerAssignment",
     "assignedDateTime": "2020-07-23T16:55:09.6202662Z",
     "orderHint": "xxxxxxxxxxxxxxxxxxxxxP)",
     "assignedBy": {
     "user": {
     "displayName": null,
     "id": "xxxxxxxxxxxxxxxxxxxxxxxxx"
     }
     }
     }
     }
     }

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow