cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simondpalmer
Helper III
Helper III

Iterate through existing collection for id values required for new collection. Then group by distinct values and create percentage of adjacent column values

 

I have an existing collection of group id's and plan id's and want to create a new collection record that uses these id's to create a percentage of completed tasks per plan.. This is to provide data for a progress chart next to each plan in a Gallery. As below

 

Capture.JPG

 

I have the following below for the existing collection:

 

Clear(MyGroupandPlansGalleryItems);
ForAll(
       RenameColumns(MicrosoftTeams.GetAllTeams().value, "id", "groupId"),
       Collect(MyGroupandPlansGalleryItems,  AddColumns(Planner.ListGroupPlans(groupId).value,"groupname",displayName, "groupId", groupId))
);

 

Capture.JPG

 Which works great.

 

Problem:

As understand I need now to create a collection of tasks for each of these plans (which requires both group id and plan ids). I have tried the following:

 

Clear(MyGroupandPlansCompletedGalleryItems);
Collect(MyGroupandPlansCompletedGalleryItems, AddColumns(Planner.ListTasksV3(MyGroupandPlansGalleryItems.id, MyGroupandPlansGalleryItems.groupId).value));

 

Intention:

As mentioned at the beginning, I want to group by plan Id and show percentage of tasks that are completed. I was going to use the "percentComplete" values from task details to create that percentage of completed tasks per plan.

Record of individual tasks below:

percentCompleteplanId
0BGdKsoj4AUuCWxQRd5DHAmUAEh6b
0BGdKsoj4AUuCWxQRd5DHAmUAEh6b
50BGdKsoj4AUuCWxQRd5DHAmUAEh6b
50BGdKsoj4AUuCWxQRd5DHAmUAEh6b
100BGdKsoj4AUuCWxQRd5DHAmUAEh6b

 

Intention is to Group By plan Id and create percentage of "percentComplete" for chart image. Something like below:

 

taskspercentCompletedplanId
60BGdKsoj4AUuCWxQRd5DHAmUAEh6b
20HNI2WZ3F7kWlP8XXh-SiImUACDfO

 

I intend to apply what I learn here to do the same by bucketid and appliedCategories.

Any help would be appreciated!

0 REPLIES 0

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,907)