web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Fill Collect with Team...
Power Apps
Answered

Fill Collect with Teams values

(0) ShareShare
ReportReport
Posted on by 14

Hi,

I need to create a Collection with the Groups and their Channels of Teams like this:

 

GroupDisplayName                     GroupId                                ChannelDisplayName
20-1 Expedientes              id-dsjadoakdjhakdhkas         2020-Exp1 (1rt Channel of 20-1 Expedientes)
20-1 Expedientes              id-dsjadoakdjhakdhkas         2020-Exp2 (2nd Channel of 20-1 Expedientes)
20-2 Expedientes              id-dsjadoakdjhakdhkas         2022-Exp1 (1rt Channel of 20-2 Expedientes)

 

I tried to create a ForAll sentence:

ForAll(

Filter(MicrosoftTeams.GetAllTeams().value;"Expediente" in displayName);

Collect(TeamGroupCollect;GroupdisplayName:displayName;idGroup:id;ChannelDisplayName:ForAll(MicrosoftTeams.GetChannelsForGroup(id).value.displayName;displayName)})

)

But it creates a estructure like this:

 

GroupDisplayName           GroupId                                ChannelDisplayName
20-1 Expedientes          id-dsjadoakdjhakdhkas       Table of Channels of Group 20-1 Expedientes
20-2 Expedientes         id-dsjadoakdjhakdhkas        Table of Channels of Group 20-2 Expedientes
20-3 Expedientes         id-dsjadoakdjhakdhkas        Table of Channels of Group 20-3 Expedientes

 

F1.PNGF2.PNG

 

Please help with the sentence to create a single collection with the structure desired of a single collect with the GroupDisplayName

Thanxs!

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @DavidBP 
    To do this I think you will need to create two FORALL loops like this.

    ForAll(
     Filter(MicrosoftTeams.GetAllTeams().value;"Expediente" in displayName) As Table1;
     ForAll(
     MicrosoftTeams.GetChannelsForGroup(id) As Table2;
     Collect(
     TeamGroupCollect; {
     GroupdisplayName: Table1.displayName;
     idGroup:Table1.id;
     ChannelDisplayName: Table2.Value
     });
     )
    );

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • DavidBP Profile Picture
    14 on at

    @mdevaney 

     

    Somthing is not ok with your formula but i can't find what....

    I think that somthing is missing here... but i don't know...

     

    Captura.PNG

    Please can you helm me?

    Thank you very much.

  • DavidBP Profile Picture
    14 on at

    @mdevaney 

     

    Finally I find the error, this is the solution:

     

    ForAll(
     Filter(
     MicrosoftTeams.GetAllTeams().value;
     "Expediente" in displayName
     ) As Table1;
     ForAll(
     MicrosoftTeams.GetChannelsForGroup(Table1.id).value As Table2;
     Collect(
     TeamGroupCollect;
     {
     GroupdisplayName: Table1.displayName;
     idGroup: Table1.id;
     ChanneldisplayName: Table2.displayName
     }
     )
     )
    )

     

    Thank you very much!!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard