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 / hide gallery if nothin...
Power Apps
Answered

hide gallery if nothing is selected

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have an app with only 1 screen and I am doing everything on this one screen.

 

There is a gallery that is conected to a SharePoint list in there and there is a DatePicker there too.

 

I have Filtered my Gallery so that it sorts results to me based on the date picker.

 

When i start the app the Gallery is either empty or there are some results in it depending on the Today().

 

I would preffer if the Gallery was empty every time until a date from the date picker gets selected.

Is there a way for me to do this?

 

I have tried following a suggested solution from a similar question. HERE.


By Shanescows
I am guessing something you changed is causing this. No problem, we will ignore it, and make your form act the way you want in this scenario. 

1. For your Display Form set the Visible property to ShowMyForm
2. In your Gallery. Change the > icon to be Select(Parent);UpdateContext({ShowMyForm: true})
3. For the Screen that these items are on: change the OnVisible property for the screen to 
 UpdateContext({ShowMyForm: false})

All done. 

To enhance the app a little I would add a Label that says "please select an item to see the details" and put it in the same spot as the display form. Then set the labels Visible property to !ShowMyForm How Fancy is that?

I couldnt figure out how i could do this and still remain on the same screen.

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    So you mention "until a date in the date picker gets selected".  I assume you already have the datepicker with Today in it - so therefore, it is selected!

    I would say you have 1 of two possible approaches to this:

    1) Set the Visible property of your Gallery to :  CountRows(yourGalleryName.AllItems)>0

        This will hide the gallery if there is nothing in it.

     

    2) Set your datepicker to Blank() and not have it default to Today. Then set your Gallery Visible to: !IsBlank(yourDatePicker.SelectedDate)

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Option 1 could work ok except on those days when i actually have items in the results.

     

    Option 2 looks like a better option as my Results are always hidden.

     

    Thank you for this solution.

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard