web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : JcZrMRLXNIxaOVG3X6f/wa
Power Apps - Building Power Apps
Unanswered

Combining Sort and Filter on Gallery

Like (0) ShareShare
ReportReport
Posted on 20 Nov 2018 22:21:28 by 2

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.


Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 22 Nov 2018 at 02:06:49
    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?

  • bhodges-Solaris Profile Picture
    2 on 21 Nov 2018 at 16:05:50
    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

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 20 Nov 2018 at 23:12:28
    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

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 688 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 499 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

Last 30 days Overall leaderboard