web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to reselect the pr...
Power Apps
Unanswered

How to reselect the previously selected item in a gallery before collection rebuilt

(0) ShareShare
ReportReport
Posted on by 31
Hi there,
I am trying to solve the following problem. I have a gallery galMain connected to a collection collMain. The collMain collection contains a column with the unique textID for each item. My app is created like this: the user selects an item from a gallery, and the selected item's textID is automatically saved into a variable called varLastItem. Then the user provides some data, patches the SharePoint list, and the collection collMain gets rebuilt. After this rebuilt, the gallery of course selects the item which is defined in gallery's Default property.
 
My question is - how can I reselect the last selected item when I have its ID stored in a variable? My idea is to set a Default property of the gallery to something like this:
If(IsEmpty(varLastItem)=true,{},???)
Unfortunately I don't know how to define the ??? part of the function properly. Maybe there is even better solution to my problem?
Thank you so much for your replies! :)
Categories:
I have the same question (0)
  • Verified answer
    ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Something like this
     
    If(!IsEmpty(varLastItem), Lookup(yourTable, varLastItem = whateverID))

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard