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

Notifications

Announcements

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

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:
I have the same question (0)
  • 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
    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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard