cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
araelius86 Helper I
Helper I

Sort Gallery by list display

Hello,

 

My current formula for Gallery1 reads:

Distinct(SortByColumns(Filter('TABLE', StartsWith(Department, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending)), Title)

So this populates my Gallery Titles with the Departments for all users and because each user has a department attached to them I use "Distinct" to only get one of each department in the Gallery.

I however (and after doing some searching) cannot find how to sort by the List order. I don't want Alphabetical I just want the Gallery to populate as the list has the Departments.

Any help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Sort Gallery by list display

Try
Distinct(Filter('TABLE', StartsWith(Department, TextSearchBox1.Text)),Title)

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Sort Gallery by list display

Hi ara,
I believe that distinct populates from the first instance of the item in the list then rejects any other identical items until it finds the next unique item. If you want the departments sorted in a particular order I suggest you create a new list in the order you prefer and bring it in as another data source.
araelius86 Helper I
Helper I

Re: Sort Gallery by list display

If this is so then it should be populating the Gallery as I want it as my Department column is in the order I want it to display, however it is sorting the Gallery by alphabetical order instead.

Super User
Super User

Re: Sort Gallery by list display

Try
Distinct(Filter('TABLE', StartsWith(Department, TextSearchBox1.Text)),Title)

View solution in original post

araelius86 Helper I
Helper I

Re: Sort Gallery by list display

That worked a treat!

 

Cheers

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

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,381)