cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Reset all fields with one command?

Hi All!

 

I'm trying to clear A LOT of fields in a form with a single (or maybe just a few) lines of code.

From what I've read so far, I have to use the Reset() command on every single field, which I'd like to avoid.  Not because I'm lazy but because there's gotta be a better way?

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Impactful Individual
Impactful Individual

Re: Reset all fields with one command?

7 REPLIES 7
Highlighted
Impactful Individual
Impactful Individual

Re: Reset all fields with one command?

Highlighted
Super User
Super User

Re: Reset all fields with one command?

If you put NewForm(your form) somewhere (a button, OnSuccess of the form, OnVisible of a screen etc), all of the fields will be reset.

Highlighted
Regular Visitor

Re: Reset all fields with one command?

I guess that's my issue.  It's a fill-and-email with a button press.  There is no data being pulled or stored.  I just want to clear all the fields once the email is sent.

 

Unless I'm misunderstanding, you need a data source to create a "form"?

Highlighted
Impactful Individual
Impactful Individual

Re: Reset all fields with one command?

Forms do expect some sort of data source, to define the columns/cards that the form displays and their respective data types. What have you defined for your Forms DataSource property?

 

How many fields are you populating/resetting?

 

Also, here is details on understanding how forms work and their purpose.

Highlighted
Community Champion
Community Champion

Re: Reset all fields with one command?

 
Highlighted
Regular Visitor

Re: Reset all fields with one command?

I created a Sharepoint list to store the values since I was previously sending an email and not storing anything.

 

However, I found the Form control too limiting for the dense formatting this form requires (multi-page, 50 items per page).

 

I'm going to stick with Patch / Reset commands.  I'm just disappointed that there is no easy way to reset the entire app without closing and reloading.

 

 
 

2020-04-12 09_56_37-KGC Job Day Sheet - Saved (Unpublished) - Power Apps.png

Highlighted
Community Champion
Community Champion

Re: Reset all fields with one command?

Hi @relionbrian ,

You might try

  1. SubmitForm
  2. Navigate to a blank screen
  3. ResetForm
  4. NewForm
  5. Navigate back

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.

 

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

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