cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver III
Resolver III

Clear text input in component?

I would like to build a navigation component which has a search box. I want to be able to clear the search box from a button on a screen which is not part of the component. I was going to try to pass in a variable to the component and then set that variable to the text input's default property but appears I can't use a variable data type as a custom property. 

Can anyone point me to a different way to do this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver III
Resolver III

Re: Clear text input in component?

Update: I was attempting to pass variables to the component via component panel on the right-hand side of the screen instead of the formula bar at the top of the screen. Variables can be passed in through the formula bar. Using the link mentioned as a guide, here was my full solution:

  • Add a Boolean custom property to the component (in this case called ResetText). Check Raise OnReset when value changes
  • Set text input Default property to ""
  • Set text input Reset to ComponentName.ResetText
  • Add a button to the screen with the component. Set OnSelect to Set(resetText, !resetText);Set(resetText, !resetText);
  • Set ResetText in component (using formula bar) to the global var resetText

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Clear text input in component?

Hi @Cooper01 ,

 

See the below thread answered for your query.

https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-clear-a-Text-Input/td-p/3545


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
Highlighted
Resolver III
Resolver III

Re: Clear text input in component?

Thank you for the suggestion @KrishnaV however it's not clear to me how to relate this to components. The solution sets context variables on screen visibility and from my understanding variables cannot be passed to a component.

Highlighted
Resolver III
Resolver III

Re: Clear text input in component?

Update: I was attempting to pass variables to the component via component panel on the right-hand side of the screen instead of the formula bar at the top of the screen. Variables can be passed in through the formula bar. Using the link mentioned as a guide, here was my full solution:

  • Add a Boolean custom property to the component (in this case called ResetText). Check Raise OnReset when value changes
  • Set text input Default property to ""
  • Set text input Reset to ComponentName.ResetText
  • Add a button to the screen with the component. Set OnSelect to Set(resetText, !resetText);Set(resetText, !resetText);
  • Set ResetText in component (using formula bar) to the global var resetText

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,016)