cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KarlAddi
Helper I
Helper I

Reset Search Text Box

I'm having trouble with resetting a search box. So my app has a main screen and there is a search box on this screen

This is the main screenThis is the main screen

So the user is able to type in what they are looking for and when they click the search Icon, it brings them to the gallery with the item they typed in as a filter

 

The OnSelect of the search Icon is :

ClearCollect(SearchRecord, MainSearchText.Text);
Navigate(BrowseScreen,ScreenTransition.Fade);

 

So far, this all works. On the BrowseScreen, the seachtextbox.Default is set to :

(If(!IsBlank(First(SearchRecord).Value), First(SearchRecord).Value, ""))

 

And the gallery Item is set to:

Filter('Table', TextSearchBox1.Text in Name || TextSearchBox1. Text in 'Pn' || TextSearchBox1.Text in 'Supplier Pn')

 

The issue I am having is that when the user clicks the "Home" Icon, I want the search bar to reset. I know that it isn't resetting because the default of this search text box is set to 

(If(!IsBlank(First(SearchRecord).Value), First(SearchRecord).Value, ""))

 

So even when I call the Reset(SearchTextBox), it is defaulting back to the default code. Is there any way around this ?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
RusselThomas
Microsoft
Microsoft

Hi @KarlAddi ,

By your design, wouldn't the search bar reset (or at least, be set to "") if you cleared SearchRecord using 

 

Clear(SearchRecord)

 

before you reset the search bar?

Kind regards,

RT

View solution in original post

2 REPLIES 2
RusselThomas
Microsoft
Microsoft

Hi @KarlAddi ,

By your design, wouldn't the search bar reset (or at least, be set to "") if you cleared SearchRecord using 

 

Clear(SearchRecord)

 

before you reset the search bar?

Kind regards,

RT

View solution in original post

I knew it was an easy fix I just couldn't figure it out. Thank you very much !!! 🙂 🙂 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,256)