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 / Return to Gallery last...
Power Apps
Unanswered

Return to Gallery last selected record

(0) ShareShare
ReportReport
Posted on by 202

I have a fairly complex Gallery based on SQL query that has variable filters and sort options (below).

When I select a record in the gallery, the program navigates to a detail Form screen for updating information for that gallery record.

Upon return to Gallery, I refresh the data source to reflect changes just added, and after a brief pause, the record I chose is still selected.  So far so good.

 

However, there are 500+ records in the gallery.  When I have had to navigate to a record towards the middle or end of the gallery records (loading additional groups of records to gallery as I go down), I select the record, make changes to detail form as before.  However, when I return to the Gallery, I am returned to some unspecified area of records.  The original selected record is not selected and nowhere in sight.

Is there a way to make sure I return to originally selected record under these circumstances?

 

Thanks for any insight you have.

 

lknudson1_0-1653007187492.png

 

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @lknudson1 

    In the OnSuccess property of the form,  capture the edited record in a variable:

    Set(vrecord, Self.LastSubmit);Back()

    In the gallery set the Default property to vrecord

  • lknudson1 Profile Picture
    202 on at

    This throws an error when I try to set default to vrecord:

     

    lknudson1_0-1653009956945.png

    Sample of Items definition:  Includes lots of conditions for sort and filter conditions, but just basically a record from the query, "v_Job_Task_Source"

     

    lknudson1_1-1653010104007.png

     

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @lknudson1 

    In the Default property of the Gallery, Try

    Lookup(v_Job_Task_Source, ID=vrecord.ID)

  • lknudson1 Profile Picture
    202 on at

    Do you think will that just bring me back to the one record?

    And when I first open the gallery how will that be affected?

    I will try it and let you know.

    Thanks

  • lknudson1 Profile Picture
    202 on at

    "bring back to the one record",

    like it will only be one item in gallery, vs. showing the one record with all the other gallery items still there?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @lknudson1 

    All the items will be there but that one will be selected. 

  • lknudson1 Profile Picture
    202 on at

    This works fine if I am toward the beginning of the list.  But if I have scrolled down to later section of the list, return to (gallery page data is refreshed), and the selected job is lost.  Even if I do data source refresh prior to returning to list, it is lost.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard