cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GertVonck
Kudo Collector
Kudo Collector

Let a gallery keep its context

Hi everyone,

 

I have a gallery with an Navigate on the OnSelect. When I return from the destination screen to the screen where the gallery is displayed, the gallery is re-initiated and shows the first records again instead of staying on the record that was selected before the navigation occured.

 

Is there a way to ensure that users, who clicked on a certain gallery record, can continue browsing the gallery from that point onwards when returning to that screen?

 

Have tried with Default property, templateFill etc but no success so far.

 

Thanks!

 

 

Gert

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Gert,

I think what you want as something like Id Sequence,but I don't find the perfectway untill now.

I tried by the buttons to refresh and test as next.

Step one: insert the button and name: start and set its Onselect:

ClearCollect(
    app,
    {Id:1, Name:"a"},{Id:2, Name:"b"},
      {Id:3, Name:"c"},{Id:4, Name:"d"},
      {Id:5, Name:"e"}, {Id:6, Name: "f"})

Step2:insert one button name:from item1 and set its Onselect: Set(selectedId,0)

Step3: Insert one gallery and name:Gallery6_1 and set its items:Filter(app,Id>=selectedId)

                set its NextArrow6_1(arrow's name)'s Onselect  :Navigate(destination_1, ScreenTransition.Fade);Set(selectedId, Gallery6_1.Selected.Id)

 

test_just the suggestion1.gif

View solution in original post

5 REPLIES 5
xyzzyx666
Resolver I
Resolver I

Hi @GertVonck

What I understand is you want the gallery screen to direct the record you choose last time? Is that correct?

I have tested as next:

Set the Gallery control's TemplateFill property to this: If(ThisItem.IsSelected,Blue,White)

Hope this can be helpful.

gallery keeps its context.png

test_highlight the record seletected1.gif

 

 

Hi,

 

Not exactly what I need. Assume I do the following actions as an end user:

 

Screen 1 (that contains a gallery with 500 records):

- Scroll down in a gallery to record 100, and select it.

-> The OnSelect triggers the "Navigate(Screen2,Fade)" action

 

Screen 2 (that contains details of the selected record):

- Do something (doesn't matter for this use case)

- Press the back button (back() or Navigate(Screen1,Fade))

-> The back button navigates me back to Screen 1

 

Problem: The gallery on screen 1 is not pointed to record 100 anymore, but to record 1 again. This is particulary frustrating in the use case that a user wants to continue with record 101, 102, 103 and so on (so in this case they go through the gallery 1 by 1)

 

Question: Is it possible to tell the gallery that, when navigating back to the screen, it should keep its focus on record 100 instead of refreshing and showing record 1 again?

 

Thanks,

 

 

Gert

Hi Gert,

I think what you want as something like Id Sequence,but I don't find the perfectway untill now.

I tried by the buttons to refresh and test as next.

Step one: insert the button and name: start and set its Onselect:

ClearCollect(
    app,
    {Id:1, Name:"a"},{Id:2, Name:"b"},
      {Id:3, Name:"c"},{Id:4, Name:"d"},
      {Id:5, Name:"e"}, {Id:6, Name: "f"})

Step2:insert one button name:from item1 and set its Onselect: Set(selectedId,0)

Step3: Insert one gallery and name:Gallery6_1 and set its items:Filter(app,Id>=selectedId)

                set its NextArrow6_1(arrow's name)'s Onselect  :Navigate(destination_1, ScreenTransition.Fade);Set(selectedId, Gallery6_1.Selected.Id)

 

test_just the suggestion1.gif

View solution in original post

Anonymous
Not applicable

Thanks for your post @GertVonck and thank you for your help @xyzzyx666!

 

@GertVonck - can you review the latest reply and advise if it helps?

 

@Anonymous

@xyzzyx666 

 

Thanks for the input, highly appreciated. This could indeed be a workaround. On the other hand, if I would apply a filter I could also do this by using a status field for every item, so for sure filtering would be able to provide a solution here.

 

Anyways I do believe that a gallery deserves a property to keep its context, I logged an idea but so far no success yet 🙂

 

https://powerusers.microsoft.com/t5/PowerApps-Ideas/Allow-a-gallery-to-keep-its-context-when-navigat...

 

Cheers,

 

 

Gert

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (19,356)