cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
maulloa1
New Member

Edit Forms not refreshing after data submitted and form opened again

I have built a page to edit my sharepoint site. I have an edit form created to facilitate this. The form's "Default Mode" is set to "FormMode.Edit" and the "Item" is set to "Gallery2.Selected". When I press my button to edit the entry it pulls all the data for that sharepoint line item. I can edit it, submit it, and the sharepoint gets updated. The issue is if I select the edit button to make another edit the form is empty and I can't make a second edit without refreshing the whole page.

 

Any ideas would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@maulloa1 

This is not making sense.

1)

You stated - "When I press my button to edit the entry it pulls all the data for that sharepoint line item"

Are you stating that you are in no other way populating your form, you are just selecting an item in the gallery, which then shows the record in the form and then you use the button to submit?

 

2) When you say your "SharePoint Page Name" do you mean this to be your List name?

 

Either way...if I read between the lines of what you are stating, then the real issue is your formula on the button.

First, you should never issue another action after your SubmitForm - for two reasons 1) how do you know the submit was a success and 2) the form may not be completed submitting yet...so you will wipe out the data.

 

However, the real clue is that you are issuing a NewForm function.  This will put the form in New mode and it will ignore your Item property...and thus no data.

 

So, get rid of the NewForm function in your formula.

You don't need the ResetForm function you have sprinkled into the other actions - that is only resetting the form back to the default mode (Edit) which is why you think it is working.  But, the reality is, you don't need it, you just need to get rid of the NewForm function.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@maulloa1 

What is the formula on your Edit button and what is the Formula on the Items property of your gallery?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

The edit button "OnSelect" is set to "SubmitForm(Form4); NewForm(Form4)". The "Items" property is set to my sharepoint page name.

 

Thanks for the reply

I figured it out I believe. I updated the for OnSuccess, OnReset, and OnFailure to be "ResetForm(Form4)"

RandyHayes
Super User
Super User

@maulloa1 

This is not making sense.

1)

You stated - "When I press my button to edit the entry it pulls all the data for that sharepoint line item"

Are you stating that you are in no other way populating your form, you are just selecting an item in the gallery, which then shows the record in the form and then you use the button to submit?

 

2) When you say your "SharePoint Page Name" do you mean this to be your List name?

 

Either way...if I read between the lines of what you are stating, then the real issue is your formula on the button.

First, you should never issue another action after your SubmitForm - for two reasons 1) how do you know the submit was a success and 2) the form may not be completed submitting yet...so you will wipe out the data.

 

However, the real clue is that you are issuing a NewForm function.  This will put the form in New mode and it will ignore your Item property...and thus no data.

 

So, get rid of the NewForm function in your formula.

You don't need the ResetForm function you have sprinkled into the other actions - that is only resetting the form back to the default mode (Edit) which is why you think it is working.  But, the reality is, you don't need it, you just need to get rid of the NewForm function.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Ah excellent a cleaner way. Thank you! that worked. Sorry if I wasn't super clear. Fairly new to this whole thing.

RandyHayes
Super User
Super User

@maulloa1 

No problem.  Glad it helped.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
RandyHayes
Super User
Super User

@maulloa1 

No problem.  Glad it helped.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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 (5,964)