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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,278)