cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lknudson1
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.

 

lknudson1_0-1653007187492.png

 

7 REPLIES 7
Drrickryp
Super User
Super User

@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

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
Super User
Super User

@lknudson1 

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.

Thanks

"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
Super User
Super User

@lknudson1 

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

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,808)