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 / Improving textbox inpu...
Power Apps
Unanswered

Improving textbox input search

(0) ShareShare
ReportReport
Posted on by 138

I have a textbox input that, when text is entered searches a Gallery (ProjectListGallery). I'm trying to figure out how to create a more robust search for the user. Currently I'm using the code below but it makes for a very "picky" search and doesn't always return the expected results. 
Question: Is there a way to do some sort of if any field in the gallery contains the text from the input box, display it?

 

Filter(Projects, 
 StartsWith(Title, SearchBoxInput.Text)
 ||StartsWith(Department, SearchBoxInput.Text) 
 ||StartsWith(OrgPTID, SearchBoxInput.Text)
 ||StartsWith(TextRequester,SearchBoxInput.Text)
)

 

Categories:
I have the same question (0)
  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi @Jltitus  - I see you're using startswith, which is probably to get around delegation? - How many records are in your dataset?

     

    If delegation isnt an issue, you could use 'Search' or 'in' functions to undertake a contains search. The latter, being more flexible in terms of the field types it can work with.

     

    If delegation is an issue, you could use nested filters inside a Search or In expression as long as you knew that when the filter was applied this would always reduce your dataset down to a number below the delegation limit that the outer  Search or In could work with. You could even have the visibility of your search box hidden until someone first of all engaged a filter.

     

    Hope this is of some assistance

  • Jltitus Profile Picture
    138 on at

    @AmDev I'm pretty new to apps so I'm not familiar with delegation. I'll go look that one up. As for your question, my dataset has 1K rows at the moment with more added every month.

     

    How would I use the "Search" or "in" functions?

  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi @Jltitus 

     

    Yes, would recommend to read up on delegation - it's basically the inability of Power Apps to delegate certain queries to the underlying datasource. For this reason, Power Apps has a delegation limit up to a max of 2000 items. What this means is that for non-delegable queries, power apps will accept up the first 2000 (unprocessed) records from the data source, which it will then process locally. This limit is set to protect performance. For delegable queries, there is no issue as the datasource does the processing and supplies Power Apps with the results.

     

    So where at all possible it's better to work with delegable queries. It just so happens that what you have used is delegable (startswith on text fields) - though this is limited if you would rather have a contains search experience.

     

    Delegation info here: Understand delegation in a canvas app - Power Apps | Microsoft Docs

     

    One example of a potential work around (but not perfect) is to pre-filter the data using a delegable filter query and then search on that filtered dataset.

     

    Syntax for a standard Search, which is not delegable is:

     

    Search(Datasource, SearchStringColumn1, Column2 etc)

     

    But if you pre filter your data down to a quantity that will always be less than your delegation limit, you can then perform a search on the filtered data set. The result of that filter statement then becomes the Datasource in the above Expression. So then it becomes this:

     

    Search(

         Filter(YourData, Dropdown.Selected.Value = Department),

              SearchBoxInput.Text, "Text Column1", "Text Column2", "Text Column2"

    )

     

    The important thing here is to always be sure that when you apply the filter the nr of items is always less than the delegation limit defaulted as 500, but can be increased to 2000. Also hide your search box if say '!IsBlank(Dropdown.Selected.Value)'

     

    Hope this helps

     

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 525 Most Valuable Professional

#2
Haque Profile Picture

Haque 273

#3
Kalathiya Profile Picture

Kalathiya 232 Super User 2026 Season 1

Last 30 days Overall leaderboard