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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,699)