I need a app that list the tasks in planner and then group by assigned name.
I use in powerapps to collect the tasks:
ClearCollect(MyPlansItems; Planner.ListMyPlansV2().value);;
ForAll(MyPlansItems;Collect(MyPlanTask;Planner.ListTasksV2(id).value))
It works, but return a response not like that descrived in doc (see link : https://docs.microsoft.com/it-it/connectors/planner/#listtasks_response_v2)
The column related to the assigned fields is not present.
see this picture:
Thanks
Stefano
Solved! Go to Solution.
After search forever on the internet and still not finding a solution for this, I made a breakthrough.
You can pull the list of assigned users by using a two step process.
1.) Collect your ListTasks
2.) Run that collection through an Ungroup function for _assignments.
Example:
1.) ClearCollect(TColAllTasksPre,Planner.ListTask_V3(groupid,id))
2.) ClearCollect(TColAllTasks,Ungroup(TColAllTasksPre,_assignments))
This will give you a record in your collection of every TaskID (and their details) and every Assigned User to that task.
ID 1 - User 1
ID 1 - User 2
ID 2 - User 57
ID 2 - User 51
ID 2 - User 41
You can choose to keep them seperated, or regroup them by TaskID and Concat the users together, or run a Distinct to pull them through multiple galleries, etc.
I never would have thought it was as simple as ungrouping to fix the scope evaluation.
This list could get big quickly pending on how your organization uses tasks and if it assigns to many, but once a collection is in powerapps it shouldn't have delegation issues at least. As I've just started this process for my organization and we haven't used planner much I can't say how much it could bog things down, but we'll see.
Hi @Piste,
Have you checked the following article?
PowerApps Planner connector reference
Which explains the returns value of ListTasksV2.
See if that would help in your scenario.
Best regards,
Hi @v-micsh-msft,
thanks for reply.
The article don't is official microsoft documentation, but is what really return the connector.
The official documentation tell that the response have the "id of the user to whom this task was assigned to".
But I see that this is a string, but the assigned user may be more of one, then I think that this is should be a table.
Well, my needs is to have the name of "assigned to", but I undestand that is not possible.
It's okay; I'll be fine.
By Stefano
After search forever on the internet and still not finding a solution for this, I made a breakthrough.
You can pull the list of assigned users by using a two step process.
1.) Collect your ListTasks
2.) Run that collection through an Ungroup function for _assignments.
Example:
1.) ClearCollect(TColAllTasksPre,Planner.ListTask_V3(groupid,id))
2.) ClearCollect(TColAllTasks,Ungroup(TColAllTasksPre,_assignments))
This will give you a record in your collection of every TaskID (and their details) and every Assigned User to that task.
ID 1 - User 1
ID 1 - User 2
ID 2 - User 57
ID 2 - User 51
ID 2 - User 41
You can choose to keep them seperated, or regroup them by TaskID and Concat the users together, or run a Distinct to pull them through multiple galleries, etc.
I never would have thought it was as simple as ungrouping to fix the scope evaluation.
This list could get big quickly pending on how your organization uses tasks and if it assigns to many, but once a collection is in powerapps it shouldn't have delegation issues at least. As I've just started this process for my organization and we haven't used planner much I can't say how much it could bog things down, but we'll see.
Thanks for the reply, I'll try to implement it as soon as possible
The _assignments is not being recognized by the function
It sends me an error saying that column doesn't exist
Oddly what I posted doesn't even match what I used, I must have failed at generalizing.
Here is what my working code looks like. This is self contained so should work on a Button anywhere:
ClearCollect(
TCol365id,
Office365Groups.ListGroupMembers( YOUR GROUP ID HERE )
);
Collect(
TColAllTasksPre,
Planner_1.ListTasksV3(
YOUR GROUP ID HERE,
YOUR PLAN ID HERE
));
ClearCollect(
TColAllTasksAssignedPre,
Ungroup(
Ungroup(
TColAllTasksPre,
"value"
),
"_assignments"
)
);
ClearCollect(
TColAllTasksAssigned,
AddColumns(
TColAllTasksAssignedPre,
"User365",
LookUp(
Ungroup(
TCol365id,
"value"
),
id = TColAllTasksAssignedPre[@userId],
displayName
)
)
)
**I apply this to all plans and all groups I'm apart of so this is a truncated version still, but works as a stand alone for one group one plan. I also grab the creator of the task in a similar function to the 'createdBy' field.
Thanks for answering so soon
It was really helpful
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
267 | |
221 | |
76 | |
38 | |
36 |
User | Count |
---|---|
338 | |
223 | |
124 | |
72 | |
56 |