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 / How to reset a field b...
Power Apps
Answered

How to reset a field before leave a particular screen

(0) ShareShare
ReportReport
Posted on by 2

On a screen I type criteria to filter the gallery on which my another gallery are also based.

All working fine.

But issue is that for example, I searched as shown below in the image, moved to another screen, when I come back, I find the search field criteria still exist. Once I leave the screen , I want it to be reset for blank.

 

Is it possible to reset the search criteria field before moving the another screen, so when user comes back, he will have filter, then he will type as per his requirement

pls. guide 

 

 

 

MIA27_0-1709971364774.png

 

Categories:
I have the same question (0)
  • Verified answer
    cha_cha Profile Picture
    4,932 Moderator on at

    Hello @MIA27 

     

    You can use Reset(ControlName) command.

  • MIA27 Profile Picture
    2 on at

    Please guide at what property to be applied the code to reset the control.

    On screen visible on return to the screen or else during exit

     

  • Verified answer
    MK-04030856-0 Profile Picture
    on at

    in the OnSelect of for example a button in a Gallery Item you'd set:

     

    Reset(Searchbar_1)

     

    This can be added to any OnSelect that would make you shift to another screen like:

     

    Reset(Searchbar_1);
    Navigate('Screen_2', ScreenTransition.UnCover)

     

     

  • MIA27 Profile Picture
    2 on at

    Thank you noted your message, will be testing it,

     

    In my situation, I have around 6 Textbox for filter criteria of the gallery. Which I click a button to clear all the textbox, below is the images for better preview.

     

    Is it possible while navigating to another screen by clicking on a + Button, the clearAll button can get clicked by code.

    As both the job can be done at one click (it will clear all fields as well as open other screen, Clearbutton has the code to reset all the 8 fields as shown in the image)

    .

     

    MIA27_0-1710220937327.png

     

     

  • Shravyashree_01 Profile Picture
    174 Moderator on at

    Hi @MIA27 , I usually set a variable example: Set(varReset,true) - usually on the onVisible , but can be used on select of any control as well.

    Then I add varReset in the "reset" property of the TextInput. This can be used in the "Reset" property of multiple controls which you want to reset. 

    It saves time and reduces the code as well

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • MIA27 Profile Picture
    2 on at

    I noted your method. Its good, can use it.

     

    But my question remained unanswered. By click of one button, another button its onselect property code can run?.

    It will be for my learning and future use.

    Please guide

  • Verified answer
    Shravyashree_01 Profile Picture
    174 Moderator on at

    Yes. Lets say there are 2 buttons, button1 and button2 , if you want to run the code of button2's onselect on click of button1 

    you have to simply write Select(button2) in the onSelect property of button1

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • MIA27 Profile Picture
    2 on at

    You mean to be typed as below under the navigate button's on select property : 

    Select(ClearAllButton); 
    Navigate('Screen_2', ScreenTransition.UnCover)

     

    Note : On select of navigate button, I am trying to run the code of ClearAllButton.

    So all my fields will clear as well as it will move to another screen

    suggest if I am going ok

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard