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 / Sort Gallery by ComboB...
Power Apps
Answered

Sort Gallery by ComboBox and Text Input using Both or One or the Other

(0) ShareShare
ReportReport
Posted on by 95

I feel like this should not be as difficult as I'm making it out to be... I have a PowerApp with a Gallery on the home screen. I want the gallery to display all items in the SharePoint list unless a user types in the TextInput1 field, or uses the ComboBox drop down to pick a Status. It should be as simple as this:

1. User goes to Power App and sees ALL items in the SharePoint list displayed via the gallery.

2. User can choose to type / search for a record by "Submission Name." - Gallery is filtered to items matching their search text.

3. User can choose a status from the ComboBox drop down. - Gallery is filtered to items matching the status choice.

4. User can do both, choose a status value AND then start searching for an item by it's Submission Name. 

 

I'm at my wit's end! I have searched these boards back and forth and I haven't found anything that will do what I need it to do...

 

I've tried the following Code. Something is wrong because it allows me to filter the gallery by the Status, but then not the text input. It's not allowing me to do both. Please help!

SortByColumns(
 Filter(
 'BARC Submissions',
 ComboBox1.Selected.Value = SubmissionStatusChoice.Value || TextInput1.Text in 'Submission Name',
 varSortOrder
 ),
 "GoLive",
 varSortOrder
)
If(
 IsBlank(ComboBox1),
 SortByColumns(
 SortByColumns(
 AddColumns(
 'BARC Submissions',
 "SubmissionStatusValue",
 SubmissionStatusChoice.Value
 ),
 "GoLive",
 varSortOrder
 ),
 "SubmissionStatusValue",
 [
 "Open",
 "On Hold",
 "Validated"
 ]
 ),
 Filter(
 'BARC Submissions',
 ComboBox1.Selected.Value = SubmissionStatusChoice.Value,
 varSortOrder
 )
)


BARCSorting_1.png

 

Categories:
I have the same question (0)
  • Verified answer
    EddieE Profile Picture
    4,641 Moderator on at

    @cjwilson80 

    You are close with your first bit of code, try this

    SortByColumns(
     Filter(
     'BARC Submissions',
     ( Len(ComboBox1.Selected.Value)= 0 || 
     SubmissionStatusChoice.Value = ComboBox1.Selected.Value ), 
     TextInput1.Text in 'Submission Name'
     ),
     "GoLive",
     varSortOrder
    );
    
    // Note: you are using the 'in' operator and this isn't delegable to SharePoint. 
    // If you want/need a delegable function, try using StartsWith, eg
    
    SortByColumns(
     Filter(
     'BARC Submissions',
     ( Len(ComboBox1.Selected.Value)= 0 || 
     SubmissionStatusChoice.Value = ComboBox1.Selected.Value ), 
     StartsWith( 'Submission Name', TextInput1.Text)
     ),
     "GoLive",
     varSortOrder
    );
    

    ** Note: the above will only work for Single Select combo boxes, not Multi select

     

  • cjwilson80 Profile Picture
    95 on at

    You are my hero! This works, thanks 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

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
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard