cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

task list v2 return old version response

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:

planissue.JPG

 

Thanks

 

Stefano

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

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.

 

View solution in original post

7 REPLIES 7
Highlighted
Community Support
Community Support

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,

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

Hi @v-micsh-msft,

 

 

 

 

Highlighted

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.

 

View solution in original post

Highlighted

Thanks for the reply, I'll try to implement it as soon as possible

Highlighted

The _assignments is not being recognized by the function

It sends me an error saying that column doesn't exist

Highlighted

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.

 

Highlighted

Thanks for answering so soon

It was really helpful

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (13,202)