cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnjohn123
Super User
Super User

Why i can not submit the same form twice

I have a form, and a button, now when i click on submit >> i want the user to have the ability to resubmit again>> but currently when the user submits the form for the first time it will be saved successfully>> but when the user clicks on the submit button again>> the form submission will fail with the following message "An entry is required or has an invalid value. please correct and try again'"

 

here is my form:-

 

 

submit.png

 

any advice?

 

9 REPLIES 9
BCLS776
Super User
Super User

To get a form to submit a second record of data, you'll need to have two things working:

  1. The form needs to be in FormMode.New (usually done by calling NewForm)
  2. The appropriate Default/Update properties for each card on the form need to be populated with valid data

Do you know if that is the case with your app?

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

@BCLS776  yes this is already there,, but what do you exactly mean by "to submit a second record of data"?


@johnjohn123 wrote:

@BCLS776  yes this is already there,, but what do you exactly mean by "to submit a second record of data"?


My understanding so far is that you wanted to submit the form a second time, resulting in a second record in your data source - are you after something different than that?

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

@BCLS776yes you are right

BCLS776
Super User
Super User

OK, can you tell us where your app calls NewForm() so we can verify that is working correctly? It doesn't appear in the OnSelect property of the Submit button, so it must be somewhere else.

Also, please open a Monitor session before you test the app next, so we can verify the actions of the app.

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

@BCLS776but currently after submitting the form i will stay on the same form .. buy if i click on submit i will get this error "An entry is required or has an invalid value. please correct and try again'"


@johnjohn123 wrote:

@BCLS776but currently after submitting the form i will stay on the same form .. buy if i click on submit i will get this error "An entry is required or has an invalid value. please correct and try again'"


This error indicates a problem I described in point #2 above: The appropriate Default/Update properties for each card on the form need to be populated with valid data. The form will not submit successfully unless it has all required fields filled out for the new record.

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

@BCLS776  ok inside the form OnSuccess i added this :-

 

insucc.png

 

but did not solve the issue.

 

also i checked that all the fields inside the form has values

I've noticed several other things that may be causing an issue:

  • The OnSuccess calls ResetForm and then NewForm; only NewForm is required
  • There is a different form referenced than used with your Submit button (RegistrationForm_1 vs RegistrationForm_2)
  • The trainNumber variable is being set at this point - is this the intended behavior? If that card is part of your form, it is being cleared/defaulted prior to this Set and may not have the value you expect

Any of these things could contribute to the errors you are seeing

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,156)