Announcements
Hi,
I have a gallery (Gallery 1) that is filtered from the selection of a gallery (Gallery 2) on the previous screen. I have a button that deletes a row from the Gallery 1 (a sharepoint list row). The delete function works fine, but my Gallery 1 is reset to a different selection from Gallery 2. Below is a gif of it happening, notice how the row isn't just deleted but resent to a different data input.
Hi @Anonymous ,Can you please describe the issue in more detail with the reference code?But for Remove Rcord you can use like below code -
Remove(Clollection/ListName,ThisItem);and Please cross-check on the remove button you are not resetting the Parent gallery. Maybe that is the reason if you resetting.Thanks,
@VijayTailor You have to watch the gif. The delete is not the problem, my gallery resetting to another item is
@VijayTailor
Sorry, I didn't see the second half of your reply. below is the "OnSelect" formula. I don't have any resets in it. Could that be in another area?
Also, heres a picture of the Powerapps Monitor. The 'delereRow' is being followed by a 'getRows', which seems to putt a different set of rows than what i started with
Hi @Anonymous ,You can do one thing.try like this ( Like - ThisItem, Not Galry.Selected)See the reference below -
Remove(TestAkshay,ThisItem)
Thanks,Vijay Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
It doesn't come as an option because I'm putting a (Yes/No) menu inbetween. Again, the delete function works fine, its just that it refreshes my gallery to a different item than I had originally entered after
Hi @Anonymous ,
You are trying to refreshing data source after row removed. Can you check plz, may that is also the reason of refresh gallary.
I think I found someone with a similar problem. I might be able to make this work.
https://powerusers.microsoft.com/t5/Building-Power-Apps/Bug-Gallery-with-calculated-values-will-lose-Selected-index-when/m-p/161150#M54252
@Anonymous
The reason your gallery is losing its selected item is because you are altering the underlying datasource that it is associated with.
The referenced posting you have will give you a workaround, but keep in mind that after that, referring to the Galleryx.Selected property will no longer be accurate.
You can certainly attempt to implement that or you can consider using the Default property of the Gallery to maintain the selection to a selected value.
Hi @RandyHayes,
I'm looking into the Default section as a solution. I'm running into a problem though, the Default says its expecting a "Record" but I need a table of results to return in the Gallery
No, Default on a Gallery is a Record ONLY. It is not a table. The table is the Items property, the Default is the EXACT record in that items table to be selected. The default is only one record because you can only have one record selected in a gallery at a time.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 396 Most Valuable Professional
11manish 134 Super User 2026 Season 2
MS.Ragavendar 101 Super User 2026 Season 2