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 all input fields...
Power Apps
Unanswered

Reset all input fields to default after creating a collection with them

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

I am building an app which creates a collection with the following input fields: Textboxes, Datepicker, Checkboxes, Dropdowns.

The Problem is, after I built the collection (using a button) the values in the input fields won't reset to their default value.

So when I want to write a new collection, I always have to delete the old entries I did before.

Do you know any "OnClick Set Default(Checkbox1.Value), Default(Textbox1.Text),....." command?

Please let me know.

Thanks for your help.

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @Anonymous 

    Put this code in the OnSelect property of your button.

    Set(resetInputFields, true); Set(resetInputFields, false);

     

    Then put this variable in the Reset property of all your input fields.

    resetInputFields

     

    Now when you click the button they will all reset to whatever value is in their default property

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • v-yutliu-msft Profile Picture
    on at

    Hi  @Anonymous ,

    Do you want to reset all input fields to default after creating a collection (using a button)?

    It can be easily implemented by using Reset() function. I’ve made a similar test for your reference:

    Step1:Add a TextInput control(TextInput1);

    Step2:Add a DatePicker control(DatePicker1)

    Step3:Add a CheckBox control(CheckBox)

    Step4:add a DropDown control(DropDown2)

    Step5: add a Button control(SUBMIT) and set it’s OnSelect property to:

    Collect(
    
     Demo,
    
     {
    
     Text: TextInput1.Text,
    
     Date: DatePicker1.SelectedDate,
    
     Check: Checkbox1.Value,
    
     Dropdowns: Dropdown2.SelectedText.Value
    
     }
    
    );
    
    Reset(TextInput1);
    
    Reset(DatePicker1);
    
    Reset(Checkbox1);
    
    Reset(Dropdown2);

    If you still have any question please don’t hesitate to let us know.

     

     

    Best Regards,

  • Community Power Platform Member Profile Picture
    on at

    Hello @mdevaney , I have tried to reset the fields in my form using the solution as suggested above.

     

    My input is 

    aaaa3_1-1674094751766.png

     

    However, when I clicked on reset button, only the order ID input field has been reset.

     

    My output is

    aaaa3_0-1674094106922.png

     

    For both quantity and estimated delivery date, I have used variables as its default control (which I can view the individual values after clicking on view order details button)

     

    May I know how should I modify my code to reset all properties? Thank you.

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