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 Not Refreshed ...
Power Apps
Unanswered

Gallery Not Refreshed After Patch

(0) ShareShare
ReportReport
Posted on by 172

Hi There,

 

I have been trying to get a small gallery for 'Note's to refresh after the Notes table has been patched. When you first open the screen, the gallery is populated with the 'notesCollection' created by this formula : 

 

ClearCollect(notesCollection, SortByColumns(Gallery2.Selected.Notes, "createdon", Descending));

 

This results in a nicely formatted Gallery like this : 

 

Serviced2000_0-1629872413155.png

When I add a new Note the 'Save' button formula  looks like this :

 

Patch(Notes, Defaults(Notes), {Title:txtAmendmentNoteSubject.Text}, {Description:txtAmendmentNoteBody.Text}, {'Regarding (_objectid_value)': SelectedPlacement}, {isdocument:false});ClearCollect(notesCollection, SortByColumns(SelectedPlacement.Notes, "createdon", Descending));UpdateContext({showAmendmentNoteDialog:false})

 

I've highlighted the ClearCollect command because that's what I've found in multiple places while researching the problem, but the gallery now looks like this : 

Serviced2000_1-1629872527502.png

I can see that the gallery has been refreshed, the data is added to the Notes table and the data has been pulled into the collection (that's the highlighted one) but all the other label text is now missing. 

 

If I go back to the main screen and re-select the item, the Gallery looks great again.

 

There must be something obvious I'm missing, but can anyone help point this out?

 

Thanks!

 

 

Categories:
I have the same question (0)
  • KvB1 Profile Picture
    1,596 on at

    In your highlighted clearcollect, what is SelectedPlacement?

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Serviced2000 If you don't need the collection for other purposes, it would be better to avoid it and set the Items property of the Gallery to, SortByColumns(Gallery2.Selected.Notes, "createdon", Descending)

  • Serviced2000 Profile Picture
    172 on at

    Hi @KvB1 ,

     

    SelectedPlacement is a record / item passed as a variable from "Gallery2" on the main page of this app.

  • Serviced2000 Profile Picture
    172 on at

    Thanks @CNT ,

     

    I'm pretty sure that's what I did to begin with and then I had to change it to a collection (but I can't remember why). I'll give this another go...

  • Serviced2000 Profile Picture
    172 on at

    Hi @CNT ,

     

    I made this change and it displays well, but when I Patch the notes table the gallery doesn't refresh on screen. I'll go do some digging but if you know of a way I can trigger this, that would be valuable.

     

    Thanks!

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @Serviced2000 ,

     

    After the notes Patch and before the ClearCollect would you try adding Refresh(Notes) and check if gallery data is updating ?

     

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

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard