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 / Create an "All" option...
Power Apps
Answered

Create an "All" option for cascading dropdowns applied to a gallery

(0) ShareShare
ReportReport
Posted on by 53

Hello everyone. I have built a simple app that filters and searches through a gallery (Sharepoint List Datasource). The "Category and Sub-category are cascading dropdowns as each Category could have multiple subcategories. I have the app programmed to default to "All" on the category dropdown so that all categories can be seen simultaneously. I did this by adding this code to the App "Onstart" field. 

JDH138_2-1631630965254.png

The collection then populates the Category dropdown, giving the "All" option that displays all categories. 

JDH138_3-1631631019631.png

Here is the code in the "items" Property of the gallery.

JDH138_5-1631631561661.png

 

 

Here is an example of when "All" is selected in the Category Dropdown. (The subcategory dropdown appears when anything other than "All" is selected)

JDH138_0-1631630598228.png

My issue comes when I select a certain category from the Category dropdown, I would like to create and default to an "All" option at the top of the dropdown for each subcategory once a category is selected in order to avoid it auto choosing the first value in the subcategory dropdown (In this case its "IRA". Basically, I would like to allow a user to see all subcategories in the gallery for a certain category when chosen. Like so. Does anyone have any ideas, workaround, advice? Thanks a lot!

JDH138_4-1631631425599.png

 

 

 

 

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    in your subcategory dropdown make Allowempty property true.

    in your filter code add for blank condition.

    Subcat.Value = DropDown.Selected.Value || DropDown.Selected.Value = Blank()

  • Salem Profile Picture
    187 on at

    I would add to @zmansuri solution:

    Replace the dropdown with a combobox and set "InputTextPlaceholder property" to "All" which will show the value you want "All" without having to select any value.

    Also make sure "Select Multiple" is false.

    Salem_0-1631634725431.png

     

  • JDH138 Profile Picture
    53 on at

    Thanks for the reply! Am adding this in right? (The highlighted portion)

    Dropdown1 = Category

    Dropdown2 = Subcategory

    JDH138_1-1631635451035.png

     

     

  • Verified answer
    zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    No,

    Since it's a picture i can't copy the code but it's something like this:

    Filter('Policy Library', Category = Dropdown1.Selected.Value || Dropdown1.Selected.Value= "All",

     Subcategory= Dropdown2.Selected.Value || Dropdown2.Selected.Value= Blank() )

  • JDH138 Profile Picture
    53 on at

    Will this work with the following formula being used in the dropdown(Or combobox)?

    JDH138_0-1631635979896.png

     

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Distinct(Filter('Policy Library', Category = Dropdown1.Selected.Result),SubCategory).Result

  • JDH138 Profile Picture
    53 on at

    I have an additional question if you don't mind helping me out. When I select a category it shows all subcategories just like I wanted.

    JDH138_0-1631662431651.png

    Once I select a subcategory and then try to change back to the "All" items view, the blank space is gone and only gives the option to select the subcategories separately UNLESS I reselect the selected item. Any ideas on how to have the blank "All" option as a constant in the dropdown? Thanks!

    JDH138_1-1631662589972.png

     

     

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 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard