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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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