web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Reset Search Text Box
Power Apps
Unanswered

Reset Search Text Box

(0) ShareShare
ReportReport
Posted on by 12

I have a search text box where I added and X icon that changes visibility depending on the text in the search box.

 

for the X icon: If len(TextBoxSearch.Text)=0 visible false else true.

 

When the X is visible and th euser clicks on it, it should clear the contents of the search box but it is not working

 

OnSelect: TextBoxSearch.Clear; (not working)

OnSelect: TextBoxSearch.text=""; (not working)

OnSelect: TextBoxSearch.text=" ";TextBoxSearch.text=" "; (not working)

 

Please advise.

 

 

 

 

Categories:
I have the same question (0)
  • hpkeong Profile Picture
    2,944 on at

    Hi

     

    Tow Methods:

     

    1. Button.OnSelect = UpdateContext({TextBoxSearch.text=" "}); UpdateContext({TextBoxSearch.text=""})

    - first " " with space

    - second "" no space

     

    2. Alternatively, you may also use:

    TextBoxSearch.Reset = Button.Pressed

     

    Hope this helps.

  • Verified answer
    Meneghino Profile Picture
    6,949 on at

    Hi @jmontoya,

    @hpkeong is absolutely correct.  I actually prefer his suggestion 2. (but you need a button and not an icon; I don't think icons have a Pressed property).  But that is easy just place a button intead of the icon, make its text X and remove all border/background etc.

     

    Also, there is a simpler alternative: text inputs have this x for clearing the contents.  Whether it appears in the control is regulated by the TextBoxSearch's Clear property (see here in the Clear entry), so you just need to set this to true.

     

    However, the X generated by the clear property is not visible in all browsers and clients, at least in my experience.  This is a bug, but it should be fixed sooner or later.

  • angelofleming Profile Picture
    14 on at

    The solution is to pass the name of the control that you want reset to the reset function.

    Reset(TextInputName)

  • Community Power Platform Member Profile Picture
    on at

    Are you mad. "." is not supported inside UpdateContext({TextInput9.Text=" "})

  • Community Power Platform Member Profile Picture
    on at

     "." is not supported inside UpdateContext({TextInput9.Text=" "})

  • Mühle Profile Picture
    85 on at

     

    Reset(SearchBox)

     

    The text input will be cleared and will shown default value or hint text.

     

    Also there is setting in properties of text input called "Clear Button". If you set this, the "X" button will be shown automatically.

     

    Best regards

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard