cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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?

 

 
 
1 REPLY 1
Highlighted
Community Support
Community Support

Re: Strange behavior from SubmitForm()

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');
ResetForm(AddMaterial)

 

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

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (10,574)