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.Selected chang...
Power Apps
Answered

Gallery.Selected changing after submitting Edit Form

(0) ShareShare
ReportReport
Posted on by 138

I've seen a few similar posts about this issue on here, but it looks like the most recent is from 2018 or so and I'm really hoping there's a solution now.

 

I have a PowerApp being used for tracking child enrollment in our preschools. It's a pretty big app with a page per stage of the enrollment process, and everything on each page is designed to display the Gallery.Selected Child. Each child has a unique ChildID that is identical across all SP lists this thing kicks back into. We have noticed that when someone employs a filter on the main gallery (such as typing in the beginning of a child's name into the search bar), after submitting an Edit Form on any of these pages the app will save the changes, but switch to the next child listed on the filter. As far as I can tell this only happens when there's a filter employed on that initial gallery, and it seems to be happening just about EVERY time. Anyone have any advice?

Categories:
  • Verified answer
    zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Set variable on gallery's icon.

    Set(varRecord,ThisItem)

    Wherever you are using Gallery.Selected. Use varRecord instead. For eg. Form's item property.

     

    Write this in Gallery.TemplateFill

    If(varRecord.ID=ThisItem.ID,AliceBlue)

    This way you'll know which record is selected right now.

    if you need more help. @Shanescows  has an amazing video on it.

    https://youtu.be/691pRyRHWBU

     

  • susannarae Profile Picture
    138 on at

    I knew it was going to be something obvious! Thank you!

  • Evelyn-Jiang Profile Picture
    21 on at

    Hi, @zmansuri 

     

    Set variable on gallery's icon.

    Set(varRecord,ThisItem)

    Wherever you are using Gallery.Selected. Use varRecord instead. For eg. Form's item property.

     

    Thank you for the solution, I do have solved the problem that gallery.selected was changed after submitting edit form. But there is another issue, that is the updates I saved before will not be displayed unless I return back to the gallery screen and navigate to the view form again.

     

    for example, I click the next arrow and turn to view form screen, then I click the edit button to update the fields, after submitting form, the screen will return to view form screen, and the fields are still the values I made changes before. But actually the updates have been happened already. 

     

    So, I'd like to know if you have any suggestions to solve the issue, thank you very much!

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard