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 / Selection in Gallery i...
Power Apps
Answered

Selection in Gallery is ignored by Form in Power Apps

(0) ShareShare
ReportReport
Posted on by 4
First time posting here, please be gentle...  This is probably answered here somewhere, but every subject has important key words that everyone seems to know with experience, which I have so little of.  This is my second app so I am not sure how to communicate effectively here.  I will try my best...
 
I have a Gallery and a Form in the same container.  The Gallery lists the contents of a SharePoint list for the user to select from.  When a gallery item is selected, the app stores the ID of that record in a variable as below.
 
Set(varID, ThisItem.ID)
 
The Form Item property is set to lookup the necessary record based on that ID as below.
 
LookUp(ESD_Status, ID=varID)
 
When the user selects a gallery item, the Form will occasionally update its contents accordingly.  Most of the time is doesn't update at all.  Sometimes the update can take a few seconds which I attribute to the LookUp doing its job.  I know this is not efficient, but these lists only have a few items so I can spare the minimal extra calls.  Also, the Form and Gallery are pointed to the same data source.  Any ideas why this doesn't work consistently?  Is there something else I need to provide here for additional information?
 
Appreciate anyone's help in getting this resolved.  Ran into this in my last project and just scrapped that feature so I could make it available to users.  Help me Obi-Wan Kenobi, you are my only hope.
 
Regards,
Matt
Categories:
I have the same question (0)
  • sannavajjala87 Profile Picture
    824 Super User 2026 Season 2 on at
    Welcome, Matt! You've actually provided a good description of the problem, so no worries there. 
    Since your Gallery and Form are pointing to the same data source, I'd recommend simplifying the pattern. Instead of storing the ID and then performing another LookUp, try binding the form directly to the selected gallery record:
    Gallery OnSelect

    Set(varRecord, ThisItem)
     
    Form Item
    varRecord
    Or even:
    Gallery1.Selected
     
    Using the actual record is generally more reliable than storing the ID and re-querying the data source.
     
    Also, if you're using Set(varID, ThisItem.ID), double-check that the form is being refreshed when the variable changes. Sometimes forms can retain their current record until a ResetForm() or a change in the Item property triggers a refresh.
     
    A few troubleshooting questions:
    • Is the form in the same screen as the gallery?
    • Are you using Gallery.Selected anywhere else?
    • Does the issue happen more often after editing/saving records?
    • Is the form displaying stale data, or does it remain completely unchanged?
    My suspicion is that the issue isn't the LookUp itself. With a small SharePoint list, that should return almost instantly. It's more likely that the form's Item property isn't consistently reevaluating, or there's another formula overriding the selected record.
     
    As a quick test, add a label with:
    varID
    and another with:
    LookUp(ESD_Status, ID = varID).Title
     
    If those update correctly while the form doesn't, you've narrowed the problem to the form rather than the variable or lookup.
     
    I'd start by replacing the ID-based lookup with the selected record itself. That's the pattern most makers use for a Gallery → Form scenario and tends to eliminate these intermittent refresh issues.
     
    Thanks & Regards,
    Manoj Annavajjala
  • Suggested answer
    CU05081953-2 Profile Picture
    4 on at
    Excellent things to consider there.  I will do that right now...
     
    On this note, I found that I set the items that came with the form layout to DisplayMode.View which caused them to not react to selected events.  I changed them all to DisplayMode.Edit and everything went as intended.  Felt stupid over that.  A new concept for me.
     
    Referencing the Selected item in the gallery to give the form what it needs to populate the data is way simpler than I chose to do it.  I have a background in procedural stuff and this OOP is still a bit foreign to me.  Also, thank you for the Reset Form idea/option.  I don't think I am running into that right now, but that doesn't mean I won't.  I'm used to doing this with reference books all over my desk and I kinda miss that.  I wonder if there is a way to get the microsoft ronline reference on a tablet for offline viewing.  That would really be useful.
     
    Anyways, many thanks for the input.
     
    Regards,
    Matt

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

#2
11manish Profile Picture

11manish 159 Super User 2026 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 89 Super User 2026 Season 2

Last 30 days Overall leaderboard