cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ms-PowerRanger2
Advocate I
Advocate I

Navigate to Prior Screen from Successfully Save Screen

My App goes to a success screen upon saving a record.  From the success screen, I'd like to give the option to go back to the previous screen where the record exist if the user wants to re-edit or add something else.

 

I tried adding a back button and specifying the following OnSelect

 

Navigate(EditScreen1,Fade,Form1.LastSubmit) 

 

But it doesn't work.

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @Ms-PowerRanger2 

The reason is on the edit screen, the form Item property needs to be updated. Looks like the current setup for the Item property is BrowseGallery.selected. This is what main change needs to happen.

 

For this change, we have to use the same variable when you select the item from the Gallery and store the New ID when it's created.

 

Steps:

1. "OnSelect" of the browse gallery to 

 

 

Select(Parent);Set(SelectedId,BrowseGallery1.Selected.ID)

 

 

2. On EditScreen, Set Form "OnSuccess" property to 

 

 

Set(
    SelectedID,
    EditForm1.LastSubmit.ID
);
Navigate(
    SucessScreen,
    ScreenTransition.Fade
);

 

 

 

3. On Edit Screen, Form "Item" property to

 

 

LookUp(IssueTracker, ID=SelectedId)

 

4. On the Success screen, set "OnSelect" navigation to icon/button

 

Navigate(EditScreen1, ScreenTransition.None)

 

 

View solution in original post

8 REPLIES 8
RandyHayes
Super User
Super User

@Ms-PowerRanger2 

I am not sure of what you are aiming at with the Form1.LastSubmit in your function.

The formula should be: Navigate(EditScreen1,Fade)  or simply Back()

 

I hope this is helpful for you.

_____________________________________________________________________________________
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!

Either with or without the optional 3 parameter, It doesn't appear to work when I do the following...

 

Add New Record > Save Record > Land on Saved Successfully Screen > Navigate to EditScreen

 

This will show the last record that I edited but not the new record I just successfully saved. 

 

Either option will work for me if I just choose to save a record that already existed and want to go back to edit the record from the saved successful screen.

 

 

RandyHayes
Super User
Super User

@Ms-PowerRanger2 

What is the Item property of the form?

If it is a variable, then you can update the variable in the OnSuccess action of the form. i.e.  Set(yourVar, Self.LastSubmit)  then it will be the last submitted record.

But, this is a guess without knowing your Item property on the form and your OnSuccess action formula.

_____________________________________________________________________________________
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!

Hi RandyHayes, Thanks for insight.  I'm not sure I'm implementing your suggestion correctly. 

 

My Item Property is currently set to Gallery1.Item.  Are you saying to just set OnSuccess to Set(mySavedRecordVar, Self.LastSubmit)  and just reference the variable with the back arrow on the success screen?  Do I need to do something different with the Item property?

StalinPonnusamy
Super User
Super User

Hi @Ms-PowerRanger2 

 

We are discussing just navigation. So as @RandyHayes mentioned no need to use Form1.LastSubmit.

 

1. In Edit Screen, set Form "OnSuccess" property to 

 

Navigate(SucessScreen,ScreenTransition.Fade);

 

 

StalinPonnusamy_0-1628386831199.png

2. On the Sucess screen, the icon/button "OnSelect" property to

 

Navigate(BrowseScreen1, ScreenTransition.None)

 

StalinPonnusamy_1-1628386992124.png

 

It won't work for me.  I'm going back to an edit screen (Not sure if that makes a difference) ... Navigate(EditScreen1, Fade)... It never shows the record I just saved rather It seems to show the record I saved prior to that one.

StalinPonnusamy
Super User
Super User

Hi @Ms-PowerRanger2 

The reason is on the edit screen, the form Item property needs to be updated. Looks like the current setup for the Item property is BrowseGallery.selected. This is what main change needs to happen.

 

For this change, we have to use the same variable when you select the item from the Gallery and store the New ID when it's created.

 

Steps:

1. "OnSelect" of the browse gallery to 

 

 

Select(Parent);Set(SelectedId,BrowseGallery1.Selected.ID)

 

 

2. On EditScreen, Set Form "OnSuccess" property to 

 

 

Set(
    SelectedID,
    EditForm1.LastSubmit.ID
);
Navigate(
    SucessScreen,
    ScreenTransition.Fade
);

 

 

 

3. On Edit Screen, Form "Item" property to

 

 

LookUp(IssueTracker, ID=SelectedId)

 

4. On the Success screen, set "OnSelect" navigation to icon/button

 

Navigate(EditScreen1, ScreenTransition.None)

 

 

That worked!  Thanks!!!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,783)