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 / Doesn't create collection
Power Apps
Answered

Doesn't create collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a problem with collection creation. 

 

I would like to create a collection in combo Box onChange. 

This is my code for collection

 

ClearCollect(multiMember, Self.SelectedItems) 

 

 Even Though I select Items on the combo Box, my collection multiMember still empty.

The items in the combo box. 

 

Distinct(Member, Member.DisplayName)

 

 Column type person

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    The Distinct() function returns a table of nested records as below:

    vqiaqimsft_0-1684396782155.png

    You should modify as below:

    ForAll(Distinct(Member, Member.DisplayName),Value)

    vqiaqimsft_2-1684396880123.png

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks, for you answer, but this is what I came up with. But still doesn't work.

    This is items:

    If(!IsBlank(ComboBox1_1.Selected) && IsBlank(ComboBox1.Selected), Distint(Filter(colMember, DepartmentID in multi.ID,Member.DisplayName), !IsBlank(ComboBox1_1.Selected) && !IsBlank(ComboBox1.Selected), Distinct(Filter(colMember, DepartmentID in multi.ID && TeamID in multifilter.ID),Member.DisplayName), IsBlank(ComboBox1.Selected) && IsBlank(ComboBox1_1.Selected),colMember, IsBlank(ComboBox1_1.Selected) && !IsBlank(ComboBox1), Distinct(Filter(colMember, TeamID in multifilter.ID),Member.DisplayName),colMember)

     from those Items I would like to put selected values to the collection:

    ClearCollect(MultiMember, Self.SelectedItems)

     And later filter gallery by the selected collection ID. 

    Filter(colMember, MemberID in multiMember.ID)

    Here I got error that multiMember.ID name isn't recognized. 

    Also the collection multiMember is empty

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Not sure if you have try the direction I provided to solve your problem, something complext in your scenario I could not reproduce on my side, so only a direction I could provide for your reference.

     

    I could only tell you that the following formula has something syntax wrong:

     

    If(!IsBlank(ComboBox1_1.Selected) && IsBlank(ComboBox1.Selected), Distint(Filter(colMember, DepartmentID in multi.ID),Member.DisplayName), !IsBlank(ComboBox1_1.Selected) && !IsBlank(ComboBox1.Selected), Distinct(Filter(colMember, DepartmentID in multi.ID && TeamID in multifilter.ID),Member.DisplayName), IsBlank(ComboBox1.Selected) && IsBlank(ComboBox1_1.Selected),colMember, IsBlank(ComboBox1_1.Selected) && !IsBlank(ComboBox1), Distinct(Filter(colMember, TeamID in multifilter.ID),Member.DisplayName),colMember)

     

    Further, you have multi conditions in your If() statement, which needs you to make sure the each result should be matched in a same data structure, otherwise the if statement does not work. 

     

    What's more, hope you could understand that we could not reproduce your issue because there are too many details and related collection.

     

    I could only tell you that, for the Distintc() part, you need to use the ForAll() to evaluate the Value field so that the ComboBox Items could display display name of your Member field.

     

     

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 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard