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 / Work done in Gallery's...
Power Apps
Unanswered

Work done in Gallery's OnSelect is not reliable.

(0) ShareShare
ReportReport
Posted on by 11

When updating context variables in a Gallery's OnSelect event is not reliable. This is reproducible in Microsoft's "With Data" template/starter app.

 

The screenshot below shows a simple app with a Gallery showing the contents of a Dataverse Table. This was created with the "With Data" starter template. All I did was at the three labels that show Gallery.Selected and the CurrentItem context variable. Then I clicked around a lot until the two were out of sync like in this screenshot.

 

I know I can use Gallery.Selected throughout the app when I need to know the current item, but sometimes I need to pre-calculate stuff when the selected item changes.

 

The "Text" code for those labels is just:

$"Selected={BrowseGallery1.Selected.Name} :: CurrentItem={CurrentItem.Name} :: {BrowseGallery1.Selected.Name=CurrentItem.Name}"

 

GalleryOnSelect.png

Categories:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

    try moving whatever is in the gallerys onselect, to the actual controls Onselects inside the gallery itself. it has better accuracy in certain situations

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

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard