cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Clear New Form after submitting a Patch

Is there a quick and easy way to clear a form after a successful Patch save?  I have not found anything yet, except that the issue might lie in the fact that this is tied with a SharePoint list.

 

Thanks

 

Brad

1 ACCEPTED SOLUTION

Accepted Solutions
Andy_Tuke
Resolver IV
Resolver IV

After the patch function, try NewForm(FormName) to set it back to new mode.

 

Andy
Read my new blog at -
www.powerappssolution.com

View solution in original post

17 REPLIES 17
Andy_Tuke
Resolver IV
Resolver IV

After the patch function, try NewForm(FormName) to set it back to new mode.

 

Andy
Read my new blog at -
www.powerappssolution.com

Anonymous
Not applicable

Thanks and I figured it would be something very easy.  My developer mind is thinking that New Form is going to also create a new blank empty record, which I wouldnt want.

Anonymous
Not applicable

And sadly, I just tried that and when I go to add a new record, the prior ("session") information is there.  I was hoping it would clear all the fields.  Wish there was like a Form.Clear() function

Andy_Tuke
Resolver IV
Resolver IV

You mention using Patch? Are you not using SubmitForm to save the data back to your data source?
What is the data source btw? I can knock up a demo app to get the concept working and attach it here tomorrow
Andy_Tuke
Resolver IV
Resolver IV

I assume you have a New Item button, the OnSelect for that should call the NewForm function before you show/navigate to the form. Where and how we're you calling it?
Anonymous
Not applicable

Andy:

 

I was using Patch because I have two lookup fields, which are a PITA 🙂  That is the only reason I was not using Submit Form really.  The data source is a SharePoint list.  And yes, I have a (+) icon to add a record, which created a NewForm then navigates to the screen with that form.  I also am running this in Edge (not IE or Chrome) and I have not tried it yet in any other browser, so maybe that could be why?  I am sure I could one-by-one call something like Control.Text="" too.

Andy_Tuke
Resolver IV
Resolver IV

My second blog post was going to be about look up columns in SharePoint actually. I planned to write that tomorrow so bear with me

Final thought, you are talking about using a Form but then saving the data with a Patch command.  Are all your fields in the Form control or have you separated the LookUp columns into their own controls displayed next to the form?

I'm trying to picture how you've done this as the NewForm will work for the form, so I'm guessing you have some controls outside the form itself so arent getting reset

Anonymous
Not applicable

The Screen only has a rectangle with a label to serve as a header.  All other controls are in the form as data cards.  Here is a screen capture of the form I am talking about.  And this morning I rebooted the laptop so of course now, all prior data is cleared.

 

4-26-2018 7-36-21 AM.png

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

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