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 / Search gallery with a ...
Power Apps
Answered

Search gallery with a Combobox that displays All if no choice made

(0) ShareShare
ReportReport
Posted on by 160

I need to search a gallery using a combobox for the ability to use the Search fields property.  My dropdown search fields display All if no choice is made or Result = "0" but when using the same function in the Items property of the combobox, not all of the items display adn the InputTextPlaceholder property displays.  The following is the function I am using.  Apparently the Value != 0 when nothing is chosen.  What am I missing?

 

With({_items: Sort(Distinct(EmpDB, LUContractName.Value), Result)},
 ForAll(Sequence(CountRows(_items)+1, 0),
 {Result: If(Value=0, "All", Last(FirstN(_items, Value)).Result )}
 )
)

 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @GoGorilla 

    I'm not exactly following what the issue is.  You have that formula on your Items property of the Combobox...are you stating that the Items do not appear properly?

    Your Combobox is going to have (with that formula) a single column table with a column called Result, so I am not sure what you are comparing with the Value != 0 statement.  

    Can you expand a little more please?

  • GoGorilla Profile Picture
    160 on at

    @RandyHayes In the image attached, note that the other dropdowns show All where the combo box shows the find items for searching the field.  In the combo box, if the All is not default, when doing a search by Employee name in the Employee Name text search, it will not find every employee.  If I change the combo box to All, then it finds everyone.  I am not sure why this is happening.  All of the search text fields and dropdowns worked fine until I added the combobox.  The result should be if value = 0 then display All but the value apparently is not 0.  

    GoGorilla_0-1636821142877.png

     

  • GoGorilla Profile Picture
    160 on at

    @RandyHayes  What was happening was the default value for the combobox is blank therefore, it would only display those with no value in the Contracts field; therefore, when trying to use the text search fields, it would only find those with blank Contract values.  I set the DefaultSelectedItem property to {Result: "All"}.  This fixed the problem.  Thank you for your help.

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @GoGorilla ,

     

    The thing is Combo boxes allow empty selection when you have not set the DefaultSelectedItems property of it, while the Dropdowns will have their AllowEmptySelection be false by default:

    vjefferni_0-1637132831301.png

    vjefferni_1-1637132852965.png

     

    So, if you want "All" to be selected by default in the Combo box, set DefaultSelectedItems to

    {Result:"All"}

    vjefferni_2-1637133183232.png

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard