Showing results for 
Search instead for 
Did you mean: 
Advocate II
Advocate II

Return to Gallery last selected record

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.




Super User
Super User


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

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



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"





Super User
Super User


In the Default property of the Gallery, Try

Lookup(v_Job_Task_Source, ID=vrecord.ID)

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.


"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?

Super User
Super User


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

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.

Helpful resources

Ignite 2022


Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,652)