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

Stop incomplete submission navigating

Hi all,

 

I have a form with a submit button the sends the entires to a Sharepoint list. I added a second function to the button to navigate to a second screen that thanks them for their submission and outlines what they should expect.

 

The problem is it navigates to the page whenthe submission fails (eg due to incomplete fields).The error message still pops up but I know people will miss it and assume the form submitted correctly.

 

Is there arnything I can add to prevent navigation when the submission fails? 

 

This is what I have now:

SubmitForm(Form1); Navigate(Screen1, Fade)

1 ACCEPTED SOLUTION

Accepted Solutions
mr-dang
Community Champion
Community Champion

There's a few methods I'd recommend to solve this:

  • Configure the Required property of datacards so that the form cannot be submitted without those
  • Change the Disabled property of the Button so that it's disabled if the required fields are not validated or filled the way you want
  • Place a condition around the SubmitForm() function so that it only triggers when your conditions are met

 

It's a lot to describe, but I think you can search the forum for ways to do those things.

Microsoft Employee
@8bitclassroom

View solution in original post

6 REPLIES 6
mr-dang
Community Champion
Community Champion

Hi, 

Each form has OnSuccess and OnFailure properties. Instead of making your button Submit the Form and then Navigate, you can make the form Navigate upon being succesful in submitting the form. 

 

So you can set Form.OnSuccess to:

Navigate(Screen1, Fade)

And keep the button only:

SubmitForm(Form1)
Microsoft Employee
@8bitclassroom
Anonymous
Not applicable

That solved my problem but created a new one unfortunately. When I do the above the form will always submit even when required fields have not been completed.

 

I also tried making the form onsuccess 

SubmitForm(Form1); Navigate(Screen1, Fade)

 
and that stopped the incomlete submissions and the navigation on successful attempt but unfortunately always gives an error message on successful submission
 
Is there anything else I can try?
mr-dang
Community Champion
Community Champion

There's a few methods I'd recommend to solve this:

  • Configure the Required property of datacards so that the form cannot be submitted without those
  • Change the Disabled property of the Button so that it's disabled if the required fields are not validated or filled the way you want
  • Place a condition around the SubmitForm() function so that it only triggers when your conditions are met

 

It's a lot to describe, but I think you can search the forum for ways to do those things.

Microsoft Employee
@8bitclassroom

View solution in original post

Anonymous
Not applicable

I was going to come back to this and fix the issue but when I put the previous solution in place it worked perfecty.

 

Why it stopped submitting incorrectly now I'm not sure but if it's working that's good enough for me.

Anonymous
Not applicable

Great solution. I spent 2 hrs figuring out various other solutions.

Hi @Anonymous 

You can also use the Valid card and form properties to do validation before trying to execute the submitform which then triggers the infamous "An entry is required or has an invalid value. Please correct and try again." error.

Please see below video that shows how you can use this.

 

https://youtu.be/7O8HCz37Q0A

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,684)