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

Collect Planner Plans relative to their Teams

I have a collection using 

 

Planner.ListMyPlansV2().value

 

 for a combobox. However, I want to show more information per plan with the Teams (groupid) they are associated with. Look something like below:

 

Team

Plan

 

I have tried the following:

 

Collect(MyTeamsPlansGalleryItems, MicrosoftTeams.GetAllTeams().value, Planner.ListGroupPlans(Lookup(MicrosoftTeams.GetAllTeams(id).value).value)

 

To then use the "displayName" and "planName" for the ComboBox fields. Any help would be appreciated. thnx

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @simondpalmer ,

Do you want a table with the value of group name and plan name?

If so, you just need to make a little change.

Try this formula:

ClearCollect(test1,If(!IsEmpty(MicrosoftTeams.GetAllTeams().value),ForAll(MicrosoftTeams.GetAllTeams().value,AddColumns(Planner.ListGroupPlans(id).value,"groupname",displayName))));
Clear(test2);ForAll(test1,Collect(test2,Value))

//Using AddColumn function to add a column with the value of displayName that  MicrosoftTeams.GetAllTeams().value returns, which is group name.

 

 

Best regards,

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

View solution in original post

3 REPLIES 3
v-yutliu-msft
Community Support
Community Support

Hi @simondpalmer ,

Do you want to list multiple group plans based on selected group?

If so, I've made a similar test for your reference:

1)connect your app with microsoft teams, planner

2)insert a combo box to list all the teams that you belongs to (combo box1)

set the combo box's Items: 

MicrosoftTeams.GetAllTeams().value

set the combo box's OnChange:

ClearCollect(test1,If(!IsBlank(ComboBox1.SelectedItems.id),ForAll(ComboBox1.SelectedItems,Planner.ListGroupPlans(id))).value);Clear(test2);ForAll(test1,Collect(test2,value))

 //test1 will be nested tables, the part2 formula is used to collect all the value of nested tables

3)insert another combo box to list all the plans based on the selected groups 

set the combo box's Items:

test2

 

Then combo box2 will list all the plans based on the selected groups that you select in combo box1.

 

If you not want to select groups, just want to list all the plans that your groups have, you could set the screen's OnVisible to this:

ClearCollect(test1,If(!IsEmpty(MicrosoftTeams.GetAllTeams().value),ForAll(MicrosoftTeams.GetAllTeams().value,Planner.ListGroupPlans(id))).value);
Clear(test2);ForAll(test1,Collect(test2,value))

Then set the combo box's Items to : test2

 

Best regards,

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

Thank you that is great I used the last option. Though I now have the id and the title of the plan coming into test2 how can I get also the MicrosoftTeams.GetAllTeams fields as well? So I can have a combobox showing:

 

Team1

Plan1

 

Team1

Plan2

 

Team2

Plan1

 

etc..

Hi @simondpalmer ,

Do you want a table with the value of group name and plan name?

If so, you just need to make a little change.

Try this formula:

ClearCollect(test1,If(!IsEmpty(MicrosoftTeams.GetAllTeams().value),ForAll(MicrosoftTeams.GetAllTeams().value,AddColumns(Planner.ListGroupPlans(id).value,"groupname",displayName))));
Clear(test2);ForAll(test1,Collect(test2,Value))

//Using AddColumn function to add a column with the value of displayName that  MicrosoftTeams.GetAllTeams().value returns, which is group name.

 

 

Best regards,

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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,201)