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 / Multiple Search Input ...
Power Apps
Unanswered

Multiple Search Input in a single gallery using With function

(0) ShareShare
ReportReport
Posted on by

Hi,

I'm having this gallery in which i want to search texts based on different columns. 

In gallery items, i've written this code using With function:

 

With(
{
records: PCT_List
// Filter(PCT_List,StartsWith(PPID,TextInput1.Text)||StartsWith('SAP Number',TextInput1_1.Text)||StartsWith('SAP Description',TextInput1_2.Text))
},
ForAll(
Sequence(CountRows(records)),
Patch(
Last(
FirstN(records,Value)),
{rowNumber: Value}
)
)
)

I'm writing this so that I'll can have different color rows in powerapps gallery. 

DBTS7_0-1702556555018.png

 

and I also tried to use filter function with different textinputs but it is not working. (commented out that code ).

Anyone have any idea, how i can search based on different columns in this gallery with different textinputs?

 

Thanks

 

Categories:
  • WarrenBelz Profile Picture
    156,736 Most Valuable Professional on at

    Hi @DBTS7 ,

    What exactly do you want to do here - this code (note the small suggestion at the bottom) will search those three fields using StartsWith(). Note however that the output (not the input) of a With() statment is limited by your Delegation limit.

    With(
     {
     records: 
     Filter(
     PCT_List,
     StartsWith(
     PPID,
     TextInput1.Text
     ) ||
     StartsWith(
     'SAP Number',
     TextInput1_1.Text
     ) ||
     StartsWith(
     'SAP Description',
     TextInput1_2.Text
     )
     )
     },
     ForAll(
     Sequence(CountRows(records)),
     Patch(
     Index(
     records,
     Value
     ),
     {rowNumber: Value}
     )
     )
    )

     

    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

     

  • DBTS7 Profile Picture
    on at

    Hi @WarrenBelz , thanks for the reply,

    But this isn't working. Not sure why. 

    I tried writing this simple line also : 

    Filter(PCT_List,StartsWith(PPID,TextInput1_5.Text) || StartsWith('SAP Number',TextInput1_4.Text))

    But the also it is not filtering the data. When writing only 1 StartsWith it is working but not for multiple StartsWith.

    As you can see below: 

    With multiple startswith

    DBTS7_0-1702623888784.png

    With one startswith it only searches what i given in the input text

    DBTS7_1-1702623934498.png

     

     

     

  • WarrenBelz Profile Picture
    156,736 Most Valuable Professional on at

    Hi @DBTS7 ,

    When you say "not working" - is it simply not filtering or do you have an error ? Also how many records in your list as you have restricted the potential output by using the With() Statement.

  • DBTS7 Profile Picture
    on at

    It is not filtering the data.

    I have removed With function as it's not required now because the coloring part i'm doing on label fill as 

    If(
    Mod(ThisItem.ID,2) = 0,
    RGBA(60, 60, 60,1),
    RGBA(90, 90, 90,1)
    )

     

    Now I just need to filter the gallery data  without using With function. Like i showed in previous comments.

    For now there are max. 10 records in the sharepoint list.

  • WarrenBelz Profile Picture
    156,736 Most Valuable Professional on at

    @DBTS7 ,

    If you have under your Delegation limit (well under in your case), the With() statement will not affect this. If you set the Default of each of the search boxes to "" (empty string), it should work with the code you have (which I updated in my first post).

  • DBTS7 Profile Picture
    on at

    Hi @WarrenBelz , Yes i tried the code you send using With function but it is not working with multiple startswith function.

    Default is also having "" empty string.

     

    I saw many sites using same approach when doing multiple searches using multiple StartsWith. Not sure why it is not working. Also i'm not getting any delegation warning.

     

    Any other approach that i can use to filter out data on different columns?

     

    Thanks

  • WarrenBelz Profile Picture
    156,736 Most Valuable Professional on at

    @DBTS7 ,

    What is your data source ? 

  • DBTS7 Profile Picture
    on at

    Hi,

    It's a sharepoint list which is having around 15 columns and 10 rows.

  • WarrenBelz Profile Picture
    156,736 Most Valuable Professional on at

    @DBTS7 ,

    I was trying to eliminate things suspecting you were using Excel, which can be problematic on more complex filters, but SharePoint should handle this in a Delegable manner (so record numbers do not matter), however PPID, 'SAP Number' and 'SAP Description' all need to be Single Line of Text fields (StartsWith does not work with numbers or delegably with complext field types such as Choice or Lookup)

     

    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

     

     

  • DBTS7 Profile Picture
    on at

    Hi,

    All 3 columns are single text in sharepoint list. also I tried with this simple formula with collection, but it is also not working with multiple cases..... 

    DBTS7_0-1702883560327.png

    Thanks

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 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard