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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery - Sort, Search...
Power Apps
Answered

Gallery - Sort, Search, and Filter

(0) ShareShare
ReportReport
Posted on by 5

Howdy!

I’ve been having a hard time getting the right formula/function to work. I currently have a search box and a dropdown box with a Gallery. I can get the two to work together with the Gallery, but only when it uses StartsWith. This isn’t ideal since I would like to search for any part of the “Title” column. The two formulas below have each worked individually, but when I try to combine them, they create an error. I understand that the SortByColumns(Search( might cause delegation issues, but my dataset will never go over 200, so it shouldn’t be an issue (hopefully).

 

Goal: Is to be able to search by first and last name (which are both in “Title” column) and/or by the dropdown box (which uses Choices) while still sorting the columns alphabetically by “Title”.

 

Data source: SharePoint List

 

SortByColumns(Search(‘Directory',TextSearchBox1.Text,"Title"),"Title",If(SortDescending1,SortOrder.Descending,SortOrder.Ascending))

(Can’t use dropdown box, but able to search by any part of “Title”)

 

SortByColumns(Filter([@'Directory'],StartsWith(Title,TextSearchBox1.Text)&&(Dropdown4.Selected.Value="Choose Department"||Department.Value=Dropdown4.Selected.Value)),"Title",If(SortDescending1,Descending,Ascending))

(Only searches by “StartsWith”)

 

I'm very new to this so any help will be appreciated! 🙂 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,732 Most Valuable Professional on at

    Hi @CC18 ,

    This is not Delegable (but neither is Search)

    SortByColumns(
     Filter(
     [@'Directory'],
     (
     Len(TextSearchBox1.Text) = 0 ||
     TextSearchBox1.Text in Title
     )&&
     (
     Dropdown4.Selected.Value="Choose Department" || 
     Department.Value=Dropdown4.Selected.Value
     )
     ),
     "Title",
     If(
     SortDescending1,
     Descending,
     Ascending
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • CC18 Profile Picture
    5 on at

    This worked! Thank you so much! 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard