cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ermoore32
Level: Powered On

Auto-height Gallery loads then disappears on screen load

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
ermoore32
Level: Powered On

Re: Auto-height Gallery loads then disappears on screen load

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.

View solution in original post

7 REPLIES 7
Microsoft Employee

Re: Auto-height Gallery loads then disappears on screen load

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
Level: Powered On

Re: Auto-height Gallery loads then disappears on screen load

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!

Microsoft Employee

Re: Auto-height Gallery loads then disappears on screen load

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
Level: Powered On

Re: Auto-height Gallery loads then disappears on screen load

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. 

Microsoft Employee

Re: Auto-height Gallery loads then disappears on screen load

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. 

ermoore32
Level: Powered On

Re: Auto-height Gallery loads then disappears on screen load

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.

View solution in original post

Microsoft Employee

Re: Auto-height Gallery loads then disappears on screen load

Thank you for sharing your solution, @ermoore32.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 335 members 6,160 guests
Please welcome our newest community members: