I have a workflow which get called from power apps, the workflow accept 2 parameters, as follow:-
1) UserEmail
2) Progress Status
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:-
3) get all the Teams, where i am storing the Teams names inside a sharepoint list
4) get all the Office 365 groups
5) Loop through the teams and check if the Team name is inside the Groups:-
6) if so, i get all the plans owned by a group
7) list all the Tasks for the plans
😎 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:-
9) finally i am passing the Array back to power apps, by joining the array with ";" character, as follow:-
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:-
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?
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:
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"
}
}
}
}
}
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional