cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kea
Level: Powered On

Patch reverts to first item in Gallery

Hi all,

 

I have got this strange behaviour. I have 2 Sharepoint lists and want to update both lists when a button is clicked. The first time it works as expected, but then the Gallery reverts to the first item, not the selecte one. I want the gallery to stay on the selected item. As I said: when I patch the second sharepoint list, my gallery reverts to the first item in the gallery. If I remove the second patch it stays on the correct selected item. 

 

What am I doing wrong?

 

Capture.PNG

I hope someone can help me out. Listened all videos from @ShaneYoung, who saved me a lot of times. But this one is really interesting. 

 

Regards, Kea

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Patch reverts to first item in Gallery

This is normal behaviour. The data source is changing so the gallery is refreshing changing the selected item to the first in the gallery not the one you previously selected. 

 

What I do in this case is set the OnSelect in the gallery to store the item. Set(varRecord, ThisItem) then I use varRecord in place of Gallery.Selected. That way nothing changes. 🙂 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

3 REPLIES 3
sopatte
Level 8

Re: Patch reverts to first item in Gallery

I'm having a hard time understanding your scenario and the issue. I'm not sure what it is you're seeing when you say "the Gallery reverts to the first item, not the selected one". Is the selection changing? Are the contents of the gallery changing? What is in your gallery (Items property)? Maybe boil this down to a simpler case that illustrates the problem clearly.

Highlighted
Super User
Super User

Re: Patch reverts to first item in Gallery

This is normal behaviour. The data source is changing so the gallery is refreshing changing the selected item to the first in the gallery not the one you previously selected. 

 

What I do in this case is set the OnSelect in the gallery to store the item. Set(varRecord, ThisItem) then I use varRecord in place of Gallery.Selected. That way nothing changes. 🙂 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

Kea
Level: Powered On

Re: Patch reverts to first item in Gallery

 Thanks Shane!!! Keep up the good work.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,634)