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 / How to set gallery to ...
Power Apps
Answered

How to set gallery to display all items by default

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

 

I want a gallery to display all of the items in the data source when the gallery launches. Right now nothing displays by default, which is not what I want. When I type characters into the textbox matching items in the gallery display. When I select an item from Gallery1, items in the table that have a matching location display correctly on Gallery2. Gallery1 is just a gallery that displays a list of locations. 

 

Gallery1- Items: 

Distinct(SortByColumns(Testing_Database,"Location"), Location)

 

Gallery2- Items:

Filter(Search(Testing_Database,'Textbox Search'.Text, "Artist","Title","Location","Medium","Nationality"), Location = Gallery1.Selected.Result)

Categories:
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    You can do this as long as Gallery1 doesn't have anything selected. What you can do is use an "If" statement and it would look something like this:

     

    If(IsBlank(Gallery1.Selected), DataSource, Filter(DataSource, Gallery1.Selected.Results = Location))

     

    If it still looks like it is being filtered then there is a good chance that something is selected in Gallery1. To test that out you would need to add a label to the screen and give the text property the formula of "Gallery1.Selected.Results" and see if it has a value.

  • Vanilla Profile Picture
    Microsoft Employee on at

    I've set the items property of gallery2 to 

    If(IsBlank(Gallery1.Selected),Testing_Database, Filter(Search(Testing_Database,'Textbox Search'.Text, "Artist","Title","Location","Medium","Nationality"), Gallery1.Selected.Result = Location))

     

    The formula isn't giving any errors and I think it should work but it still isn't displaying any records unless I search for something or use gallery1 to select a location to filter by. I used a label to make sure nothing was being selected in gallery1 and if something was selected it displayed the text of the location as expected. 

  • Verified answer
    Vanilla Profile Picture
    Microsoft Employee on at

    What I ended up doing was duplicating the gallery and searchbar and setting the items of the duplicated gallery to:

    Search(Testing_Database,'Textbox Search_1'.Text, "Artist","Title","Location","Medium","Nationality")

     

    and the visible property to: If(IsBlank(Gallery1.Selected.Result), true, false)

     

    So the screen always displays gallery2 and  the duplicate gallery at the initial load of the screen, but only displays gallery2 if the user users gallery1 to filter by location.

     

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard