Showing results for 
Search instead for 
Did you mean: 
RoopaPendyala Helper I
Helper I

How to highlight the selection on gallery



I have  a gallery and it is set to a collection Alerts. There  is a dropdown that has different sort option applied on the gallery.

I have selected sort option 1 and selected second item in the gallery that opens further details of the selected item.

Now I change the sort option 2 and obviously the gallery list order changes with this the second item which I selected in the gallery also changes and that renders the new positioned second item's details and not the prior user selected item.


Requirement :

Even when user selects multiple options in sort drop down and the collection items gets repositioned , it should not change the details of the original selected item. The left side gallery should scroll to the original selected item where ever its repositioned in the gallery.


Any idea how this can be done? Thanks in advance.


I could manage until the details view doesnt get chnaged with sort order but the gallery is not getting scrolled to the repositioned selected object id.




Community Support
Community Support

Re: How to highlight the selection on gallery

Hi @RoopaPendyala,


Sorry but I cannot fully understand what you are trying to describe, would you please share some screenshots of your app? Also, please post the related formulas that you have used in the gallery.




Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: How to highlight the selection on gallery


Yes, Mona is right, it always helps if you have the related formula and some screenshoots. 🙂

Nevertheless if I understood correctly, you can try this..
You have a gallery that displays the items --> Gallery1
Gallery1 has a source ---> Expression1
You use a dropdown to sort the gallery --> Dropdown1

Try to do the following and check if it is working.
Dropdown1.OnChange = UpdateContext({vReset:true});UpdateContext({vReset:false})
Gallery1.Items = If(!vReset,Expression1)

In an example that I have created Expression1 = Switch(Dropdown1.Selected.Value,"1",Sort(A,ID),"2",Sort(A,text))
So it needs to change to:
Gallery1.Items = If(!vReset,Switch(Dropdown1.Selected.Value,"1",Sort(A,ID),"2",Sort(A,text)))

Edit: I assume that you have set the Default value in the Gallery1.
If not, please share the related expressions and we can find a way.

Helpful resources

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.


New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (7,249)