web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Refresh gallery to a s...
Power Apps
Unanswered

Refresh gallery to a specific item after a Patch

(0) ShareShare
ReportReport
Posted on by

I have a screen that contains a gallery and a filter container. When the user filters records by a specific status, the gallery shows all related items. When I click to select an item in the gallery, the selected item's details appear on the screen. I have a button on the screen that, when clicked, performs a patch to the data source and runs a PowerAutomate. I would like the selected record from the gallery to refresh when the PowerAutomate completes. Here is my challenge:

When the user filters the records for a status of "issued", they select any record returned in the gallery that has an issued status. They then click the NOTIFY button. That button has patch language that changes the status is "notified" and runs the PowerAutomate. When the PowerAutomate completes, the selected record in the gallery no longer appears because the gallery was searching for all records with an "issued" status. 

I would like to re-display the record that was initially selected from the gallery, showing what it looks like after the patch/PowerAutomate.

Any suggestions?

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @AnnetteM ,

     

    My idea is to add a slider control and set its' Default property to (assuming you are using SPO as a data source):

     

     First(
     Split(
     Gallery.Selected.'Version number',
     "."
     )
     ).Result

     

    The OnChange property can then be set to :

     

    Refresh('Data Source')

     

    Like this, whenever the 'Version number' of the selected item changes, for instance when it is edited in a Power Automate flow, the data source gets automatically refreshed. The downside is that every time a user selected an item in the gallery that has a different value for 'Version number' that what was previously selected, this will also trigger.

     

    You can avoid that by including a variable that is set to true only when the flow is triggered and then set back to false after the data source has refreshed.

  • AnnetteM Profile Picture
    on at

    My challenge is that if the gallery is filtered for all records with a status of "Issued", then after the Patch and PowerAutomate, the record now has a status of "Notified" (via the Patch function). The filter on the gallery is still "Issued", so it doesn't appear the version check will help as the item updated has a new status that doesn't fit the filter.  I am thinking that I would have to remove the filter from the gallery and instead have it return to the actual SPO item that was selected before the Patch/PowerAutomate. I could create a variable of the ID of the record, but how can I have the gallery refresh to that ID?

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @AnnetteM ,

     

    As I understand you want to have the edited item selected and visible in the gallery after the flow has run? If possible at all without components, it seems like a lot of work. Perhaps it's worth considering to use a form on a separate screen or in a pop-up container to display the details of the edited item...

  • MarkRahn Profile Picture
    1,229 Super User 2025 Season 2 on at

    I had something similar with a gallery and an SP List. The list had a Status field that could be changed from the Screen the user was on. There was a gallery that showed all of the items filtered on Status. I wanted to also show the item that was Patched to a new Status. To do this, I made a Filter with an Or. The first part of the Filter used the Status field. The second part of the Filter used the Item ID and a variable named gblSelectedID set to the ID of the item. The variable that contained the ID was set to 0 (a number that would never occur) when not needed.

     

    You could also use an If statement in building out your Filter and set the Sort to use the Modified field to bubble the Selected item to the top.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard