cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Piste
Level: Powered On

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
kscharber
Level: Powered On

Re: task list v2 return old version response

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.

 

7 REPLIES 7
Highlighted
Community Support Team
Community Support Team

Re: task list v2 return old version response

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.
Piste
Level: Powered On

Re: task list v2 return old version response

Hi @v-micsh-msft,

 

 

 

 

kscharber
Level: Powered On

Re: task list v2 return old version response

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.

 

Piste
Level: Powered On

Re: task list v2 return old version response

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

avc12
Level: Power Up

Re: task list v2 return old version response

The _assignments is not being recognized by the function

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

kscharber
Level: Powered On

Re: task list v2 return old version response

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.

 

avc12
Level: Power Up

Re: task list v2 return old version response

Thanks for answering so soon

It was really helpful

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 218 members 4,741 guests
Please welcome our newest community members: