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 / Filter and search with...
Power Apps
Answered

Filter and search with multiple conditions on gallery

(0) ShareShare
ReportReport
Posted on by 213

Hi,

I am trying to add one more condition on searching the gallery, but it doesn't work. 

The part I added is StartsWith(ID,TextInput0.Text), there is no error with the formula, but when I tested it, it's not working.

Anyone can help with this?

Sort(Filter('WuXi OTC digitization',StartsWith(Title,TextInput1.Text) || StartsWith(ID,TextInput0.Text) && (IsBlank(ComboBox1.Selected.Result) || 'Cost Type'.Value = ComboBox1.Selected.Result.Value) && (IsBlank(ComboBox4.Selected.Result) || Status= ComboBox4.Selected.Result) && (IsBlank(ComboBox3.Selected.Result) || Market.Value = ComboBox3.Selected.Result)),Created,If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

 

ShineTan123_0-1679910577954.png

 

Categories:
  • eltibu Profile Picture
    on at

    Looks to me that your text filter isn't set up to handle no entry into your text box. I would suggest to change

     

    StartsWith(ID,TextInput0.Text) && (IsBlank(ComboBox1.Selected.Result)

     

    to

     

    (StartsWith(ID,TextInput0.Text) Or IsBlank(TextInput0.Text)) && (IsBlank(ComboBox1.Selected.Result)

     

    Also, from your screenshot looks like you have a delegation warning that you may want to tackle.

     

    Also, is your ID column a number? In which case using a text input to supply a string should result in an error of trying to match string to number in which case you'll want to write

    (Value(StartsWith(ID,TextInput0.Text)) Or IsBlank(TextInput0.Text)) && (IsBlank(ComboBox1.Selected.Result)

    instead

  • ShineTan123 Profile Picture
    213 on at

    Hi @eltibu,

    I tried both codes, but still not working. Any ideas?

     

    ShineTan123_0-1680088482711.png

     

  • Verified answer
    WarrenBelz Profile Picture
    156,754 Most Valuable Professional on at

    Hi @ShineTan123 ,

    That is because ID is a number - to keep this mostly Delegable, try this

    With(
     {
     wData:
     Sort(
     Filter(
     'WuXi OTC digitization',
     StartsWith(
     Title,
     TextInput1.Text
     ) &&
     (
     IsBlank(ComboBox1.Selected.Result) || 
     'Cost Type'.Value = ComboBox1.Selected.Result
     ) && 
     (
     IsBlank(ComboBox4.Selected.Result) || 
     Status= ComboBox4.Selected.Result
     ) && 
     (
     IsBlank(ComboBox3.Selected.Result) || 
     Market.Value = ComboBox3.Selected.Result
     )
     ),
     Created,
     If(
     SortDescending1, 
     SortOrder.Descending, 
     SortOrder.Ascending
     )
     )
     },
     Filter(
     AddColumns(
     wData,
     "IDTxt",
     Text(ID)
     ),
     StartsWith(
     IDTxt,
     TextInput0.Text
     )
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard