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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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