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 / When user selects noth...
Power Apps
Answered

When user selects nothing in a combobox the gallery should display all the records but it gets blank.

(0) ShareShare
ReportReport
Posted on by 1,066

Dear Community,

I have a gallery1 on my form with the data of my Sharepoint List displayed.

Now i want to create a filter with a combobox that gives me the unique values of the Sharepoint column called "Afdeling".

And i have this command which works fine:

Distinct('Employee Directory';Afdeling)

But when i use no value in the combobox the gallery1 should display all the records but it's blank.

So i made this but it doesn't work:

 

Filter('Employee Directory';cmbAfdelingFilter.Selected.Value = Afdeling) || IsBlank(cmbAfdelingFilter.Selected.Value)

 

And how can i make the items in the combobox sorted?

Gr.p

 

 

 

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @PeKi72,

     

    To get the unique values from a Text column you can use Distinct():

    //US syntax
    Distinct('MyDirectory', Afdeling)
    
    //Alternative syntax
    Distinct('MyDirectory'; Afdeling)

     

    Please note that Distinct() is limited to the amount of records defined in your app settings - Data Row Limit. (default 500, max 2000) As long as your list does not exceed the Data Row Limit, this function will work as intended.

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • CU16021406-1 Profile Picture
    1,066 on at

    But I have 5000 records !!!

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @PeKi72,

     

    Distinct will not allow that natively by directly operating on your datasource. You have a few options you could try:

     

    (1) If you only have a limited set of unique 'Afdelingen' that does not change, you can store an array of Afdelingen within the app. Either via a collection and using this as the combobox property or writing the array within the Items property:

    //--collection example--
    //App Onstart
    ClearCollect(
     colAfdelingen,
     "Afdeling 1",
     "Afdeling 2"
    )
    //Items property combobox
    colAfdelingen
    
    //--array example--
    //Items property of combobox
    ["Afdeling 1", "Afdeling 2"]

     

    (2) Should the amount of unique 'Afdelingen' increase over time, you can create a separate SP list for the unique Afdelingen. This way you can simply reference this list within the combobox items property.

     

    A flow (or logic within the app) can be built to synchronize both lists. Meaning that when a new row in the MyDirectory is added, it is checked whether the Afdeling already exists in the master data list. If not, the afdeling is added.

     

    (3) Use a workaround to load all records in memory by creating a large collection. You can then use the distinct on the collection which will allow you to handle more records, since they are loaded in memory.

    Distinct(colName, Afdelingen)

     

    Additional information on creating large collections can be found in the 2 blogposts below:

     

    Option 1 and 2 would be my preferred options, performance wise.

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#2
11manish Profile Picture

11manish 165 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 110 Super User 2026 Season 2

Last 30 days Overall leaderboard