cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rockmond
Helper III
Helper III

Dynamic Sorting or Filtering of a Gallery

Hello,

 

I have a Gallery that shows various financial data based on selection of Sites, Workstreams, Year, and Time Frame.

rockmond_1-1603213075638.png

 

Currently the user can show either the annual totals or can select a specific quarter to show those quarterly data for a site-workstream combination. What I would like to do instead is, when the user selects an specific item in the gallery, another gallery or form becomes visible that shows the financial data for each quarter of the selected year. I am pretty sure I can work out the logic for the new gallery/table, but what I want is for the select item in the first gallery to move to the top of the gallery on select. That way I can position the new form to appear just under the selected item, so that the Annual figures will show on top and the quarterly data will appear beneath the selected item. So basically, what I need is to know how to sort (or filter) a gallery (again, as the gallery is already filtered based on drop downs), based on the selection within that gallery. Ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
parmiras
Advocate I
Advocate I

Uhh this might work:

 

Pull the source into a local collection, add a column called order, and then make that collection, sorted by order, the datasource for your gallery:

step1.PNG

 

In the Gallery's OnSelect, completely Clear the order column, and then update the current item's order column value to 1. The gallery will rerender with the clicked item on top.

step2.PNG

View solution in original post

3 REPLIES 3
parmiras
Advocate I
Advocate I

Uhh this might work:

 

Pull the source into a local collection, add a column called order, and then make that collection, sorted by order, the datasource for your gallery:

step1.PNG

 

In the Gallery's OnSelect, completely Clear the order column, and then update the current item's order column value to 1. The gallery will rerender with the clicked item on top.

step2.PNG

View solution in original post

Thanks. I will try this and set as solution when it works.

How'd this work out?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,969)