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 / Help with Gallery Filt...
Power Apps
Answered

Help with Gallery Filtering

(0) ShareShare
ReportReport
Posted on by 9

I have the below code:

SortByColumns(Search('To Do List', TextSearchBox1.Text, "Title"), "ID", If(SortDescending1, Descending, Ascending))

 

I need the gallery not to display results from the sharepoint data sorce that comply with the status "Completed" Ive read a few other posts but struggling to mix the code in with mine. Tom

Categories:
I have the same question (0)
  • CarlosFigueira Profile Picture
    Microsoft Employee on at

    You would use the Filter function in this scenario:

    SortByColumns(
     Filter(
     Search('To Do List', TextSearchBox1.Text, "Title"),
     Completed = false),
     "ID",
     If(SortDescending1, Descending, Ascending))

    Expressions in PowerApps can be nested, so in the example above you're filtering the result of the Search operation based on the condition that you want.

  • TomWright Profile Picture
    9 on at

    Hi Carlos,

     

    Is it possible to only show items in the gallery were completed is false, before the search is run

  • CarlosFigueira Profile Picture
    Microsoft Employee on at

    Sure, both Search and Filter functions "filter" the rows that are returned by the data source, without changing its "shape", so their order can be flipped, and the results should be the same:

    SortByColumns(
     Search(
     Filter('To Do List', Completed = false),
     TextSearchBox1.Text,
     "Title"),
     "ID",
     If(SortDescending1, Descending, Ascending))
  • TomWright Profile Picture
    9 on at

    Thanks, altough how does it know what colum to look in for the "Completed status"? This is the sharepoint formIMG2.JPG

    No results are being retunred?

    IMG1.JPG

     

    Thank you for your help, its much appreciated

  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    Ah, if your sharepoint column is named "Status", and (it seems to be) of type choice, then the expression should reference that column name, something along the lines of 

    SortByColumns(
     Search(
     Filter('To Do List', Status.Value <> "Completed"),
     TextSearchBox1.Text,
     "Title"),
     "ID",
     If(SortDescending1, Descending, Ascending))

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard