Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Strange behavior from SubmitForm()

EDIT: found it.  I SWEAR I looked through all the settings for my form, but there it was, a Navigate() off to the other page.  Good way to learn I suppose!


Good Morning,


I have what I hope is a simple problem: I'm working on an app that (among other things) updates a SQL database of electrical parts for my company.  I have an editable form with a description, a couple dropdowns, and a couple other text boxes, some required some not.  Once this is populated and the user hits the 'submit' button, the data are sent successfully to the database, but the app navigates away to a different page, and I want it to just stay put so multiple entries can be made.


In the Action area for my button, OnSelect has 'SubmitForm(AddMaterial); ResetForm(AddMaterial)'  If I use just the ResetForm() it works fine and stays on the page, but obviously doesn't send any data; I did that just to test.  The problem somehow is associated with the SubmitForm() behavior.  I've tried a couple things like using Back() and Navigate() to force it, neither of which works.  It absolutely wants to navigate away to this other page.


I've tried taking actions in other areas of the app to see if they too navigate away, and they don't, as far as I can tell it's just right here.


Is there some logic in SubmitForm() somewhere that could be doing this?  I've attached a screenshot showing the relevant area, with the button selected so it's formula shows.  Thoughts?


Community Support
Community Support

Hi @baumana ,

Could you please share a bit more about your scenario? Do you want to stay in same page after you submit your form data?

Have you solved your problem?


Please check if you have typed Back() or Navigate(...) formula within the OnSuccess property of the Edit form. If true, please consider remove the Back() or Navigate(...) formula within from the OnSuccess property of the Edit form.


In addition, as an alternative solution, I think Patch function could achieve your needs. Please consider modify the formula within the OnSelect property of the "Submit" button to following:

Patch('Data Source', Defaults('Data Source'), AddMaterial.Updates);
Refresh('Data Source');


Please consider take a try with above solution, check if the issue is solved.


Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group


Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (38,910)