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 / Gallery only defaults ...
Power Apps
Unanswered

Gallery only defaults to first record of source when Reset invoked

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have two galleries on the same page. When I select an icon in the first gallery it goes invisible and second gallery becomes visible. I need the second gallery to to default to the record containing Gallery1.Selected.opNum.  

 

I have the second gallery's Default set to First(Filter(Gallery2.AllItems, Num = Gallery1.Selected.opNum)) 

 

I've tried similar with LookUp, no luck I've tried using a variable to hold a the op number, no luck. 

 

No matter what I do, when I invoke Reset on Gallery2 it defaults all the way to the first record of the source in its Items property.

 

Help is very much appreciated. This seems like it should be simple but I can't get the default property of Gallery2 to affect anything.

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

    @Anonymous 

    Actually, the bigger question is, what is the Items property of your gallery? 

    The "signature" of the record you select in the default must match the "signature" of the items property records.

    You would think that using AllItems as your data source on a lookup would solve that, but it returns a much different signature and thus will not work.  You need to do your lookup from the datasource of the Gallery and it must match the signature.

     

    I hope this is helpful for you.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you please share a bit more about the formula you typed within the Items property of the First Gallery and second Gallery?

    Have you reset the First Gallery when you reset your second Gallery?

     

    I assume that you do not reset your first Gallery when you reset your second Gallery, please consider set the Default property of the second Gallery to following:

    LookUp(
     "Type the Items formula of your second Gallery here",
     Num = Gallery1.Selected.opNum
    )

    In addition, please also make sure the opNum column in your first data source the First Gallery connects to could match the Num column in your second data source the Second Gallery connects to.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you.  I've since determined that the behavior changes depending which browser I use; Chrome, Edge, or Firefox.

    Button in Gallery1:

     

    Set(currentOp, ThisItem.opNumCDS);
    Reset(Gallery2);
    UpdateContext({expanded: true}); //This is for visible properties

     

     

    Gallery2.Items :  

     

    Sort(Filter([@hydInstructions],AssyNumCDS = Assy, updated = 'updated (hydInstructions)'.Yes),opNumCDS)

     

     

    Gallery2.Default : 

     

    LookUp(Sort(Filter([@hydInstructions], AssyNumCDS = Assy, updated = 'updated (hydInstructions)'.Yes), opNumCDS), opNumCDS = currentOp)

     


    I have label's to print currentOp and Gallery2.Selected.opNumCDS. They are both Number type.

    In Edge: When I use the button in Gallery1 it disappears, Gallery2 appears. currentOp label shows me the correct number as selected, my Gallery2.Selected.opNumCDS flag is blank. Gallery2 shows me whatever record I was last looking at, it seems the Reset does nothing. I have another button that is just Reset(Gallery2) and it does nothing when I'm in Edge.

     

    In Firefox: Same except it always Resets the Gallery to the first record of the Items property. The reset apparently doesn't like the gallery2.default property. Label for currentOp is correct, Label for Gallery2.Selected.opNumCDS shows up but always shows me the first record of the Items. So it's at least showing me that the gallery reset to the first record.

     

    In Chrome:  The button in gallery1 swaps the visible and defaults to the 6th record of the source! I haven't changed anything going from browser to browser. If I have gallery2 showing and I hit my Reset(Gallery2) button it sends me to the 6th record regardless of what's in currentOp or which record I have selected for Gallery2 or Gallery1 for that matter. EDIT: I closed out and reopened and it went back to defaulting to the First record, not the 6th.

     

    I'm baffled. How is the behavior between browsers so dramatically different?


    Side note for Firefox, you apparently can't hide gallery scroll bars, no problem in edge or chrome but that's a different issue.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I can get the functionality I'm looking for by first ClearCollecting the records I want into a local collection and using that as my datasource for gallery2. So this is apparently not working with CDS entities. Maybe a delegation issue? I've been trying to avoid putting the second gallery on a new screen because load times suck. I want the user to be ablet o hit the "expand" button in a gallery1 record then see the "expanded" version. Gallery2 is sized such that one record takes the whole screen and has more details. So I need to be able to go back and forth quickly.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    I do find sometimes functionality is different in different browsers, but it is not often.  However, when I do, I find that it seems to only be related to how the formulas are interpreted differently.  So, I then look to simplify.

     

    So, perhaps on your Default property, try to change the formula to this:

    LookUp([@hydInstructions], opNumCDS = currentOp)

    This is assuming that the opNumCDS is a unique key.  If not, then add in the other parameters that provide a unique record.

     

    Another thing to consider is some of the advance settings of your App.  Check the Delayed Load option and perhaps change that to see if there is a delay in the load of the datasource that is causing you some issues.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I've tried quite a few iterations of LookUp , First(Sort(Filter( , using variables, not using variables, exact gallery source, gallery.allitems etc. 

    It's frustrating, I've spent too much time on it already. I'm currently setting it up with a local collection and my own navigate buttons. Load time sucks because of full images but I'm going to try to mitigate that with a "timed release" of the full images....so on navigate a degraded image will show up quick and then my full image will go visible at some time increment. So if user wants to click through quick they'll be able to at least see a fuzzy picture but if they hang out on that record the full image will come up. Better than nothing.

     

    Thanks for your help.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Definitely also look at the Delayed Load option.

    Plus, don't forget to use the Monitor tool to try and narrow down when and where data loads and delays are coming in.  That is a #1 tool to use.

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 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard