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 / Start searching the se...
Power Apps
Answered

Start searching the search-query in the Searchbox after the user presses enter not while typing

(0) ShareShare
ReportReport
Posted on by 1,085

Dear community,

I have a gallery and a textbox for searching. When i type in the textbox my search-query the app begins searching.

But what i would like is to start searching when i press Enter. How can i do that?

 

I have set the DelayOutput to true and set the OnChange to: Set(searchQuery;TextBox1.Value) 

and set the OnVisible property of my screen to: Set(searchQuery;"")

this is my code for the gallery:

 

If(
Len(TextBox1.Value) > 0;
Search(
dbEmployeeDirectory;
searchQuery;
"crcfa_voornaam";
"crcfa_achternaam";
"crcfa_afdeling";
"crcfa_titel";
"crcfa_computer";
"crcfa_badgenummer";
"crcfa_gebruikersid"
)
)

But it still doesn't work

Gr. P

Categories:
  • Verified answer
    cha_cha Profile Picture
    4,932 Moderator on at

    Hello @PeKi72 

     

    There is no default function or property that this can be done. The DelayOutput is already a great step you've done. 

     

    Would having a search button be something you'd like to have? Instead of waiting for an Enter key, the user must select Search to initiate the filter update. That's the only alternative I can think of. 

     

    When the Search button or icon is clicked, you can put this on its OnSelectCode:

    Set(searchText,TextBox1.Value)

     

    Then your gallery filter, you can do like:

    If(
    Len(searchText) > 0;
    Search(
    dbEmployeeDirectory;
    searchText;
    "crcfa_voornaam";
    "crcfa_achternaam";
    "crcfa_afdeling";
    "crcfa_titel";
    "crcfa_computer";
    "crcfa_badgenummer";
    "crcfa_gebruikersid"
    )
    )
  • Verified answer
    CU16021406-1 Profile Picture
    1,085 on at

    Hi, still not working. This is what i have done.

    1. Set the textbox property DelayOutput to true

    2 Set the Onchange property of the textbox to: Set(searchQuery;TextBox1.Value)

    3. Set the OnSelect property of the icon Find also to: Set(searchQuery;TextBox1.Value)

    4. Set the OnVisible proprety of my screen to: Set(searchQuery;"")

    5. And this is the gallery:

    If(
    Len(searchQuery) > 0;
    Search(
    dbEmployeeDirectory;
    searchQuery;
    "crcfa_voornaam";
    "crcfa_achternaam";
    "crcfa_afdeling";
    "crcfa_titel";
    "crcfa_computer";
    "crcfa_badgenummer";
    "crcfa_gebruikersid"
    )
    )

     

      

    Still it searches while typing.

     

    Gr.P

     

  • Verified answer
    cha_cha Profile Picture
    4,932 Moderator on at

    For #2, remove this code and replace it with False. That's the one triggering the search.

  • mbarbosa Profile Picture
    146 on at

    I agree with @cha_cha ,
    I think the only way to accomplish what you're trying is to have a button/icon alongside the search box and change your code to the OnSelect event of the button/icon

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

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard