cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bhodges-Solaris
Level: Powered On

Combining Sort and Filter on Gallery

Created an app from a sharepoint list and working with the default Gallery it provided. I am trying to change the default display providied while keeping the filter feature working correctly.

Syntax provided is:
SortByColumns(Filter('IT Support Log',StartsWith(Text,TextSearchBox1.Text)),"Title",If(SortDescending1,Descending,Ascending))

Image Powerapps1 shows it displays Alpha based on title.

I have altered the Syntax to:
SortByColumns('IT Support Log', "Request_x0020_received",If(SortDescending1, Ascending, Descending))

Image Powerapps2 shows the display I want but I lose the ability to Filter, I know its because I removed the Filter Function. How do I get the display I want for the gallery and make the filter section work also. Can provide more detail if needed.


3 REPLIES 3
Super User
Super User

Re: Combining Sort and Filter on Gallery

Hi @bhodges-Solaris,

Powerapps functions are nested and process  starting  with the innermost one and work outward.  So in the initial formula, the red part is the filter.  In your case I think it is confusing because the underlined Text is ambiguous.  It should refer to a column in your list that you want to filter on.  

SortByColumns(Filter('IT Support Log',StartsWith(Text,TextSearchBox1.Text)),"Title",If(SortDescending1,Descending,Ascending))

Replace the formula above with this one

SortByColumns(Filter('IT Support Log',StartsWith(Title,TextSearchBox1.Text)),"Title",If(SortDescending1,Descending,Ascending))

Now entering text in the search box should filter the list by the Title column of the list.  However, you could use any of the columns in your list for filtering. See the example below.  I used the Category column to filter the list.

Capture.PNG

 

Capture1.PNG

 

 

 

 

bhodges-Solaris
Level: Powered On

Re: Combining Sort and Filter on Gallery

Thank you for the response. I appreciate the help! When I do the above it will filter it via title first. My need is to have it filter based on Request Date. And so far when altering the Item Syntax, I can get it to look the way I want I just lose the ability to Search in the search box. It will return no value. But it will display the gallery exactly like I want. I think I understand why and that is because I have removed the Filter function all together. Trying to add the filter function into the nested formula is where I am stuck.

Formula will display what I want But I lose the filter option :
SortByColumns('IT Support Log', "Request_x0020_received",If(SortDescending1, Ascending, Descending))

 

Formula display is not what I want but the Filter is doing what I need:
SortByColumns(Filter('IT Support Log',StartsWith(Text,TextSearchBox1.Text)),"Title",If(SortDescending1,Descending,Ascending)) 


Trying to combine both to Display Date requested and have a search feature that I can look up by User/title

Super User
Super User

Re: Combining Sort and Filter on Gallery

@bhodges-Solaris,

Are you looking to Filter the list on a particular date and then sort it by Title, So that your list will only show one date? Or do you want to filter the list on title and sort it by date received?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,708)