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

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

8 REPLIES 8
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?

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
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 😉

Dasunk
Frequent Visitor

Use expression like this for submit button. If the datacard value is blank then submit button onselect will not work

 

If(
!IsBlank(DataCardBusiness.Text)
And !IsBlank(DataCardValueConLEI.Text)
And !IsBlank(DataCardValueReqDoc.Text),
DisplayMode.Edit,
DisplayMode.View
)

power_j
Regular Visitor

The form comes with validation of the fields required. You can put Submit(form) on the button and go and click on a form and go to OnSucess option to put to Navigate to another page. In this way you will be redirected only if the form was filled correctly. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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