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 / Auto-height Gallery lo...
Power Apps
Answered

Auto-height Gallery loads then disappears on screen load

(0) ShareShare
ReportReport
Posted on by 17

I have a Gallery with 'Auto-Height' enabled.  The gallery items are pulled from a SQL Datasource.  On screen load, data will populate inside the gallery then immediately disappear.  If I leave the screen then come back with 'new data' to which modifies the filter, the Gallery will stay visible the second time and then every time after that. It appears to only be the 'First Time' loading the Gallery that this bug happens. 

Categories:
I have the same question (0)
  • dinusc Profile Picture
    Microsoft Employee on at

    Hello @ermoore32,

    I would appreciate the following information that should help us to investigate the issue:

    1. Does this happen in Studio while previewing the application or only in Player when running the application?

    2. Are you using any formulas to position the child items inside the Flexible Height Gallery?

    3. Is this issue specific to a certain control of your application or it happens every time you bind a Flexible Gallery control to a SQL source and use a Filter formula?

    Thank you,

  • ermoore32 Profile Picture
    17 on at

    1. This only seems to happen when running the published version of the application.  Whether it's on iOS or via the web player. When I run a 'preview' inside the studio, the app behaves correctly.

     

    2. I do have an If statement that controls the height of the gallery based off number of results (countrows) but even if I take that out and put in a static height, the gallery appears to remove all items instantly after displaying them.

     

    3. This does seem to happen on only one screen.  I have flexible gallery on a few different screens, and I've basically copied most of the formulas and height controls, but now that you mention it, it does only appear to happen on this one screen. 

     

    Again, the interesting thing is this only seems to happen 'the first time.' 

     

    Basically, I have 3 links on my homepage that say '3 Day Report, 7 Day Report, 30 Day Report.' When I click on one, it loads the screen in question and passes a 'fromdate and a todate' variable then runs some sql based off that.  The first time hitting the page (every first time when loading the app) the gallery will show results then quickly disappear (almost so quickly you miss it if you blink).  When I hit the 'back' button to go back to the home page and select a DIFFERENT report option, the screen reloads with the new 'from date' and 'to date' variables and the screen works as expected.  If I then go back and select my 'original' option, the screen works again as expected. It doesn't matter WHICH report option I choose first, they all act the same. 

     

    Hope this helps add some context!

  • dinusc Profile Picture
    Microsoft Employee on at

    Thank you for providing the detailed information. I will try to reproduce this issue locally. Meanwhile, please check if the following helps resolving the issue:

    1. If you're using any legacy Lookup controls in your form, please replace them with ComboBox controls.

    2. Make sure the following applicatino settings is set to OFF and then re-publish the app:  "Explicit column selection":Capture.PNG

     

     

     

  • ermoore32 Profile Picture
    17 on at

    Okay, I believe I may have actually found the culprit: 

     

    Because I'm using Dates in my Filter, and I want to use SQL Delegation, I have created two hidden labels (a FromDate and a ToDate) that convert date values to integers and I pass those variables to the screen with the Gallery and use those variabels in the Filter query.

     

    On that Same screen, I also have date pickers that update those labels based off the selectedDate of the date pickers.  I think those two are interfering with the query because when I just put the 'values' of the variables I'm passing into the Filter, the gallery works as expected. 

  • dinusc Profile Picture
    Microsoft Employee on at

    Thank you for the update. In this case, I would suggest adding test labels to your application that would be bound to the resulting variables that are passed to your query. THis way you should be able to check if the conversion is done properly. 

  • Verified answer
    ermoore32 Profile Picture
    17 on at

    Okay, 

     

    I believe I have resolved the issue.  Essentially, the Filter was looking at the int(labels) which were being updated (properly) by the date pickers, but because it took just an extra millisecond or so to calculate the label, it appears the sql query was firing off too early.  

     

    I've moved the 'conversion' of the date -> int(label) directly into the filter and got rid of the labels altogether, and not only does it work better now, but it's also using delegation somehow! So I'm happy with this, and you can mark this as closed.

  • dinusc Profile Picture
    Microsoft Employee on at

    Thank you for sharing your solution, @ermoore32.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard