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

Can only create on item with NewForm function

I created a new Screen with an EditForm set to mode "new".

I can submit the form just fine to create a new item in a SharePoint list but if i want to add another new item (go to the screen again)

its says: "Your data will be retrieved" (its translated so the actual message can be different) and nothing more happens.

 

If i restart the app again i can again add one item but then get the same error for the second one.

 

How can i fix this? Is there an option that im missing?

1 ACCEPTED SOLUTION

Accepted Solutions
rubin_boer
Super User
Super User

hi @Nico_TW  try SubmitForm(yourform); NewForm(yourForm)

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

View solution in original post

5 REPLIES 5
rubin_boer
Super User
Super User

hi @Nico_TW  try SubmitForm(yourform); NewForm(yourForm)

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.
Nico_TW
Helper I
Helper I

Wow im stupid thanks!

RandyHayes
Super User
Super User

@Nico_TW 

Be careful using that formula!  SubmitForm will occur asynchronously.  That means that NewForm can very easily occur before or during the actual Submit action.  So, you run the risk of wiping out the data on the form before it is submitted.

Also...If there is an error in submitting, your NewForm function will occur anyway and will wipe out anything on the form - this can become very annoying to a user because they get NO indication that the submit failed and, even if they do, everything they entered will be gone, so they will not be able to correct and try again.

 

I would suggest putting the NewForm function into the OnSuccess action of the Form.  This way it will put the form back into New mode IF the submit is successful.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

tnx @RandyHayes 

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.
Nico_TW
Helper I
Helper I

@RandyHayes Thanks for the info! 

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,659)