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 / Show search results in...
Power Apps
Answered

Show search results in gallery only when user clicks on search icon

(0) ShareShare
ReportReport
Posted on by 603

Hi All,

 

My gallery search is working fine without any issues. However i want to change the search behaviour.

 

Search results should only be shown when user clicks on search icon. Currently search results are being shown once i type in keywords inside searchbox. May i know how to change this behaviour?

 

Below is the searchbox and code of Items Property of the Gallery

 

Iantaylor2050_0-1696765609951.png

If(
 myfavselected,
 Filter(
 Items,
 ID in Filter(
 Favorites,
 Title = User().Email
 ).CatalogID
 ),
 Filter(
 Items,
 (Len(TextInputCanvas1_3.Value) = 0 || TextInputCanvas1_3.Value in 'Item Name' || TextInputCanvas1_3.Value in Description || TextInputCanvas1_3.Value in Text('Unit Price(USD)') || TextInputCanvas1_3.Value in 'Item Category')||
 (Len(TextInputCanvas1.Value) = 0 || TextInputCanvas1.Value in 'Item Name' || TextInputCanvas1.Value in Description || TextInputCanvas1.Value in Text('Unit Price(USD)') || TextInputCanvas1.Value in 'Item Category') && 
 ((CountRows(colSelectionGal) = 1 || 'Item Category' in colSelectionGal.Value)) && 
 (IsBlank(ComboBox3.SelectedItems) || ("Under $50" in Concat(
 ComboBox3.SelectedItems,
 Value
 ) && Amount >= 1 && Amount < 50) Or ("$50 - $100" in Concat(
 ComboBox3.SelectedItems,
 Value
 ) && Amount >= 50 && Amount < 100) Or ("$100 - $200" in Concat(
 ComboBox3.SelectedItems,
 Value
 ) && Amount >= 100 && Amount < 200) Or ("Above $200" in Concat(
 ComboBox3.SelectedItems,
 Value
 ) && Amount >= 200))
 )
)

 

Categories:
  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @Iantaylor2050 

     

    To change the search behavior, you need to do the following steps:

    • Add an icon or a button that will act as the search trigger. You can place it next to your search box or anywhere you like.
    • Set the OnSelect property of the icon or button to a formula that will store the value of the search box in a variable. For example

     

    Set(searchText, TextInputCanvas1_3.Text)​

     

    • Modify the Items property of your gallery to use the variable instead of the search box value. For example

     

    If(
     myfavselected, 
     Filter(
     Items, 
     ID in Filter(Favorites, Title = User().Email)), 
     Filter(Items, (Len(searchText) = 0 || searchText in 'Item Name' || searchText in Description || searchText in Text('Unit Price(USD)') || searchText in 'Item Category')|| ...)).

     

     

    • Optionally, you can also clear the variable when the user clears the search box. To do that, set the OnChange property of the search box to a formula that will check if the text is empty and then set the variable to blank. For example, 

     

    If(
     IsBlank(TextInputCanvas1_3.Text), 
     Set(searchText, "")
    )

    .

     

    This way, the gallery will only show the search results when the user clicks on the icon or button, and not when they type in the search box.

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

     

  • Verified answer
    Michael E. Gernaey Profile Picture
    53,970 Super User 2026 Season 2 on at

    Hi @Iantaylor2050 

     

    You can fix it, but it may not look how you like.

     

    1. Create a variable, lets pretend to call it varShowResults

    2. In your Screens OnVisible or App.OnStart, set it to false.

    3. In the TextInput, in the OnChange Event, set the value false

    Set(varShowResults, false);

     

    4. In the Buttons OnClick event, after you check if the TextInput is Not black, then set it to true

    If((!IsBlank(TextInput.Text), Set(varShowResults, true), Set(varShowResults, false))
    
    And of course do whatever else you need to do in the true section.

     

    5. In your gallery of items

    // So it either shows your results, or shows no data
    If(varShowResults, Put your filter here, [])
    or
    //depends on what your showing, do either the [] or {} not both
    If(varShowResults, Put your filter here, {})
     
    


    If you like my answer, I would really appreciate if you please Mark it as Resolved, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard