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

New Item Form resets before submitting

Have been following instructions on how to create an app from scratch. I've created a screen with an Edit form in it which will be used to submit a new item to a SharePoint List. From the home screen, there is a button which takes you there OnSelect:

NewForm(CreateNewClaimForm);Navigate(CreateNewClaim, ScreenTransition.Fade)

Right now, I've just set one field ("Employee ID") as required. To submit the form, I've created a button with the following OnSelect:

SubmitForm(CreateNewClaimForm)

It was working fine initially. However, after adding some default values for some fields (e.g. current user's Manager, user email, etc), the form now appears to reset the input field of the required field before submitting when i click the submit button, throwing an error.

 

Capture2.PNG

 

Capture.PNG

 

 

 

I can't find any information on this on other forum posts. I'm working inside of PowerApps studio where it's a little tricky to debug exactly what is going on behind the scenes. Am I missing something here?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: New Item Form resets before submitting

Hi @Anonymous, you could check the Reset property of the controls in the form to see if it is somehow triggered by the submit.

Or the reset property of the form, if such exists.

 

However in my personal opinion, you are much better off not using forms if you need to do any customisation.  I have always found it easier in the end to just create the single controls as needed and then use the Patch function for any new records or editing of existing records.  Please let me know if you have any specific questions on this.

View solution in original post

5 REPLIES 5
Highlighted
Anonymous
Not applicable

Re: New Item Form resets before submitting

Done a little more testing and it appears just the "Manager" field causes this issue.

 

This is what I've set as the "Default" parameter for it:

Office365Users.Manager(Office365Users.MyProfile().Id)

 

If I set it back to "Parent.Default" the form will submit just fine... Any clues what's happening here?

Highlighted
Community Champion
Community Champion

Re: New Item Form resets before submitting

Hi @Anonymous, you could check the Reset property of the controls in the form to see if it is somehow triggered by the submit.

Or the reset property of the form, if such exists.

 

However in my personal opinion, you are much better off not using forms if you need to do any customisation.  I have always found it easier in the end to just create the single controls as needed and then use the Patch function for any new records or editing of existing records.  Please let me know if you have any specific questions on this.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: New Item Form resets before submitting

Thanks for the suggestion @Meneghino, I'll look at building a custom form using individual elements instead. 

 

It seems other people are having the same issue, I guess building your own form will have to suffice as a workaround for the time being.

Highlighted
Community Champion
Community Champion

Re: New Item Form resets before submitting

You are welcome @Anonymous

Please see the following post for a formless SharePoint solution:

https://powerusers.microsoft.com/t5/PowerApps-Forum/Timeslot-Registation-Form/m-p/23530

Highlighted
Resolver I
Resolver I

Re: New Item Form resets before submitting

In case anyone stumbles across this (admittedly very old thread) in the future - my gut feeling is that the reason you were getting an error is because the Schema that the Person/Group field looks for is different than the one you are providing.

 

In this case, since it doesn't match it just leaves it blank (which gives the appearance of it resetting, when it actually isn't).

 

To solve this, the following would likely suffice for this specific case.

 

Default for the 'Manager' column would be:

{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
        Claims:"i:0#.f|membership|" & Office365Users.Manager(Office365Users.MyProfile().Id).Mail,
    Department:"",
   DisplayName:Office365Users.Manager(Office365Users.MyProfile().Id).DisplayName,
         Email:Office365Users.Manager(Office365Users.MyProfile().Id).Mail,
      JobTitle:"",
       Picture:""
   }

 

Full Disclosure: I've not yet been able to test this myself - but I've dealt with (and am currently dealing with) plenty of these SharePoint Custom Form quirks to know that you won't always get an error message for some of these things.

 

Cheers,

 

Ramiro

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,916)