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 / selected row in galler...
Power Apps
Answered

selected row in gallery going back to previous choice when navigating off screen

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a weird problem.

lets just call this  Screen1 and Screen2

On Screen1:

I have a gallery that also has a button. when the button is pressed the navigation goes to Screen2.

On Screen2:

The data on screen2 is showing what row was selected in the first screen choice. and data from that row.

 

Problem:

For some reason after i go to screen2 from screen1  :

On screen1 the selected row is changing to another row..?? even though i'm not on that screen.

 

I'm trying to figure out how to stop the gallery on screen1 to stay on the row i selected.

 

Thanks

David

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    What are the Items properties of your Galleries??

    If there are any complex operations (sorting, datashaping, etc.) and you are submitting any data, or you reference and controls or variables that are changed at any point from screen to screen, then the Gallery will have to re-evaluate its Items property.  When it does that, it will then select the record you have in the Default property of the gallery...if you have no Default, then the first record will be selected.

     

    That should give you some clues to look over.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    stupid question.  can you re-select the same line if the gallery is re-evaluated ?

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I'm not doing any re-evaluation to the gallery when navigating to screen2. No "OnVisible" code(screen2).  However i do have code in the "Visible" method on screen1.  Refreshing the table that support the gallery.  

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    If you are refreshing the table (something you don't need to do), then it will cause the formula to re-evaluate.

    If there is no other formula in the Items property other than the data source name, then it is the refresh that is causing it.

    Is there a particular need for the refresh?

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

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard