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

Community site session details

Session Id : 5l2Q1Fg+EnMlsBg3qVICzm
Power Apps - Building Power Apps
Answered

List box control - Select all values as default

Like (0) ShareShare
ReportReport
Posted on 20 Mar 2022 04:52:29 by 240

Hello,

 

I have a dashboard like screen where I use listbox to filter items displayed form a SharePoint list(dashboard->gallery).  It is working fine except for the fact that by default(on load) all items should show in dashboard(gallery). This could be achieved by selecting all items in the ListBox on screen load or by having listbox select all items by default. I am not sure if this is possible. 

 

If this is not possible, is it possible to check if there are no selected items in ListBox

 

Thank you.

Categories:
  • jason-hoffman Profile Picture
    2 on 05 May 2023 at 14:20:14
    Re: List box control - Select all values as default

    I was trying to do this, too. I couldn't find a solution online, and most people simply said it wasn't possible. I decided to approach it differently to get the same result. I had a list with different categories. When a category is selected, a gallery lists the items in that category. But if there is no category selected, I wanted it to show all items in the gallery. Here's what I did:

     

    1. Set the list's default to nothing (i.e. leave it blank).

    2. In the filter for the gallery, add a condition like this:
         If(CountRows(ListBoxCategory.SelectedItemsText)>0,Category.Value in ListBoxCategory.SelectedItems,!IsEmpty(Category.Value)))

     

    The logic is that it counts how many selected items there are in the listbox. If there is at least one selection, it filters the category value to the selection. If there isn't a selection, it just verifies the item has a category. 

     

    So while you can't select all list items by default, you CAN achieve the same functionality.

     

    I hope this helps!

     

     

     

     

  • Verified answer
    Adrian_Celis Profile Picture
    1,652 Moderator on 21 Mar 2022 at 02:12:49
    Re: List box control - Select all values as default

    Hi @nemanjasovic011 

    I cannot find a way for a Listbox to select all items by default. You can do this if you use a gallery though.

    But you can check if there are no selected items in the Listbox.

    IsBlank(Concat(ListBox1.SelectedItems,Value))

    Replace ListBox1 with the name of your list box.

    If the value is true then there is nothing selected in the ListBox.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete