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

Using Back() To A Screen With An EditForm On It

Hi all,

 

I have an app with a Gallery (Gallery2) on the home screen. When a user clicks the edit icon it takes them to a screen with an edit form on it.

freddiejoseph1_0-1630922022947.png

 

freddiejoseph1_1-1630922136611.png

The Edit icon has an OnSelect:

ResetForm(frmPhase1); ResetForm(frmPhase2); ResetForm(frmPhase2_1); ResetForm(frmPhase3); ResetForm(frmEmergencyServices); ResetForm('frmHCC/OCC_2'); ResetForm(frmLondonBoroughs_1); Set(varFormData, ThisItem); Navigate(Phase1); Select(Parent); UpdateContext({varEdit: false})

 

The save form button has an OnSelect of:

SubmitForm(frmPhase1); If(IsEmpty(Errors(OverpaymentDatabase)), Notify("Successfully Saved", NotificationType.Success) && Navigate(Success); Notify(First(Errors(OverpaymentDatabase)).Message, NotificationType.Error))

 

I then have a simple success screen. I want the user to go to this screen, then navigate back to the screen they were just on. However when they click the ok button (with onselect: ResetForm(frmPhase1); ResetForm(frmPhase2); ResetForm(frmPhase2_1); ResetForm(frmPhase3); ResetForm(frmEmergencyServices); ResetForm('frmHCC/OCC_2'); ResetForm(frmLondonBoroughs_1); Back(); UpdateContext({varEdit: false}) ) it takes the user back to the previous screen, but the changes the user just made don't appear in the form.

freddiejoseph1_2-1630923095813.png

Why does the newly submitted information now appear in the form? It must be something to do with the data source not refreshing, or the OK button somehow not refreshing the selected item from Gallery2.

 

Thanks,

 

Freddie

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Hi Shivam,

 

I have actually solved the issue myself. It was to do with the reset form, which I must have left by accident in some of my OnVisibles on the different screens. I removed them and now it seems to work fine.

 

Rather than navigating away from the screen, I also not just use a variable which blocks the screen rather than navigating away from it. This seems to work well!

 

Thanks for replying to me 🙂

 

Freddie

View solution in original post

2 REPLIES 2
shivam38
Advocate I
Advocate I

hey @Anonymous I just want an information from you that what you want to do like :-

    - You want the users to be sent on the main page from where they have just clicked on the pencil icon instead of going back on OK button pressed then you need to change your code as follows :- 

ResetForm(frmPhase1); ResetForm(frmPhase2); ResetForm(frmPhase2_1); ResetForm(frmPhase3); ResetForm(frmEmergencyServices); ResetForm('frmHCC/OCC_2'); ResetForm(frmLondonBoroughs_1); Navigate(Screen Name).

Note - Screen Name is same as on which you have gallery2.

And your answer about last thing why data is not displayed which is changed by the user on going back just because you have use ResetForm() which results in resetting the data after clicking on ok button so you will find nothing there.

Anonymous
Not applicable

Hi Shivam,

 

I have actually solved the issue myself. It was to do with the reset form, which I must have left by accident in some of my OnVisibles on the different screens. I removed them and now it seems to work fine.

 

Rather than navigating away from the screen, I also not just use a variable which blocks the screen rather than navigating away from it. This seems to work well!

 

Thanks for replying to me 🙂

 

Freddie

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,145)