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 / return to complex gall...
Power Apps
Answered

return to complex gallery after patching.

(0) ShareShare
ReportReport
Posted on by 235

Good Morning!

Okay I have one last (I hope) problem.  I've searched and the answers don't quite fit my situation.  Anyway I have a big GroupBy in the items of a gallery.   I've gotten my patches working from the nested gallery, didn't even have to UnGroup to do so.  ...

So after I patch, I refresh the data source and navigate back to the gallery and it's not refreshed.  I have to run OnStart in order to get the data back in.  The gallery is a groupby using a collection made from the data source, but I can't access it in any way to reload that gallery from the refreshed data source into the collection and group.

So I thought I'd be clever and move the code in items (the groupby code) onto a button and submit the button programmatically, that didn't work either.

 

Anyway, is there some definitive way to Reload the gallery with the refreshed data?

 

Thanks in advance.

Amy

@BCBuizer 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,636 Super User 2026 Season 1 on at

    Hi @AmyF ,

     

    What you'll need to do after patching the datasource (refresh is not needed since this is included when patching), is to rebuild the collection, presumably using the same formula you use in the App.OnStart property.

  • AmyF Profile Picture
    235 on at

    Hi BCBuizer,

    Yes, but where or when?  I don't build it in the OnStart, per se, I run OnStart to get it to reload.  The code for the groupby is in the items property of the outer gallery.  That's why I tried putting it on a button and then calling Select on the button.  Should that have worked?  Perhaps I gave up too early?

  • AmyF Profile Picture
    235 on at

    Also, I don't think that would work because I still need the button to be executed within items, I think... don't know very confused.  

  • BCBuizer Profile Picture
    22,636 Super User 2026 Season 1 on at

    Hi @AmyF ,

     

    Can you please share where you createthe collection? Is it in the App.OnStart property or another control/property?

     

    The formula for creating the collection should be repeated in the same property as where you have the Patch function, but after the Patch.

     

     

  • AmyF Profile Picture
    235 on at

    the elaborate groupby is in the Items property of the parent gallery on the main page.  I navigate off that screen to do the patch stuff because I thought I'd be more successful reloading the page if I had to Navigate back to it.  And now I know that's not the case so I probably can bring all of that code back to the same screen the galleries are.  I'll let you know later if it works.  Thanks for getting back to me and let me know if there's anything else you need to know or need some screen shots of something.  

     

  • BCBuizer Profile Picture
    22,636 Super User 2026 Season 1 on at

    Hi @AmyF ,

     

    It's still not clear to me at which points in your workflow the collection gets created and where it should be refreshed, so if you can share that, I can review if there's anything that needs to be done about that. 

  • AmyF Profile Picture
    235 on at

    Okay it's not a flow, it's just an app.  I've attached a diagram.  In the OnStart all I do is put the datasource into a collection: myCollection, everything else takes place in the ITEMS property of the Gallery.  A secondary screen holds a timer, does the patch, displays a message and then navigates back to the original screen.  See diagram.   

    IF after I patch and on the return if I could just execute OnStart programmatically, it would be fine.  It's just getting the newly patched data back into the gallery so the user can see their changes.   Thanks again.

    gallery_image.PNG
  • Verified answer
    BCBuizer Profile Picture
    22,636 Super User 2026 Season 1 on at

    HI @AmyF ,

     

    The thing is that your collection needs to be refreshed after you patch the data source, so the ClearCollect(...) from App.OnStart needs to be executed again in the OnTimerEnd property on Screen2. This will then refresh the contents of the collection, making them reflect in the gallery.

  • AmyF Profile Picture
    235 on at

    Thank you very much.  That worked perfectly and is exactly what I wanted.  I tried this before and it didn't work.  I tried it just now and it didn't work, but I knew what you were suggesting would work, it made sense.  I had built two collections.   Collection1 was built from the Sharepoint list, and then Collection 2 was built from collection 1. So first I Refreshed the datasource, then the two collections and that worked.   

     

    Thanks for getting me over this hump.  And I believe it's the last one. (at least I hope so)  cheers, Sir!

     

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 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard