cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MRawmountain
Level: Powered On

Navigate back to selected EditForm after submitting data.

Hi.

I really need som help w my App.

I've built a 5 screen app and can't figure out how to submit my basic user data and after that in the same button (command) return after submitting the data to the Editform. The data saves ok to the register but returns to the wrong post. I need something like (I'm soo bad at the formulas):
SubmitForm(EditForm1);; Navigate(EditForm1)

"want to navigate back to the same screen and same EditForm from where I saved my data"

 

This formula did save my data but returned back to wrong register post:

 

If(FylliForm1.Mode=FormMode.Edit;
Patch(OSchemaTestOne;BrowseGallery1.Selected;FylliForm1.Updates;FylliForm1B.Updates;FylliForm2.Updates;FylliForm3.Updates;FylliForm4.Updates;FylliForm5.Updates);
Patch(OSchemaTestOne;Defaults(OSchemaTestOne);FylliForm1.Updates;FylliForm1B.Updates;FylliForm2.Updates;FylliForm3.Updates;FylliForm4.Updates;FylliForm5.Updates));;

EditForm(FylliForm1)

 

I can't figure out how to write a formula that picks out and navigate back to the selected post in the Gallery like:

 

Navigate(OSchemaTestOne;BrowseGallery1.Selected;FylliForm1)  where FylliForm1= the EditForm I submit the data from. 

 

Does this make sense? Please help!

 

Regards Michael

7 REPLIES 7
SergioGiusti
Level: Powered On

Re: Navigate back to selected EditForm after submitting data.

Hi Michael in the form you are submitting, there are on success and on failure actions. Within these, add you navigate function. 

 

i.e. on success = Navigate(my other screen, none)

 

like this when you submit the form using the submitform function, if it succeeds in submitting to the data source it will then navigate to your other screen

MRawmountain
Level: Powered On

Re: Navigate back to selected EditForm after submitting data.

Hi again. Thanks for the respons.

 

I still have the problem.. the command takes it back to wrong EditForm.

 

How can I get the App to return to the selected EditForm post in BrowsGallery?

 

Regards

Michael

Highlighted
MRawmountain
Level: Powered On

Re: Navigate back to selected EditForm after submitting data.

Hi again

I’ll try ty explain my problem a little bit better.

I have this StartScreen (BrowseScreen1) w the register linked to a Sharepoint list.

It goes to DetailScreen1 where I can see the data in the object

When I push the Newobject button it opens 5 different forms for the 5 different input screens.
and navigates to the first EditScreen1 and in to the Editmode for the form (FylliForm1)

The formula:

NewForm(FylliForm1);;NewForm(FylliForm1B);;NewForm(FylliForm2);;NewForm(FylliForm3);;NewForm(FylliForm4);;NewForm(FylliForm5);; Navigate(FylliForm1; ScreenTransition.None)

Here I put in the basic data like user, title, date etc..

I’m now in Editmode of my first form FylliForm1;

How can I from here save/submit the data into the register and after this successful save navigate

directly back into this particular FylliForm1 on EditScreen1?

When I use this command: SubmitForm(FylliForm1) and use

OnSuccess: Navigate(FylliForm1;ScreenTransition.None)

It saves the data successfully but takes me back to a different register post’s FylliForm1
(one that has been saved a long time before)
I need a formula that takes me back to the one I submitted data from w the Navigate command..

I don’t know how to combine my command so it finds the BrowseGallery1.Selected I’m currently working with.

Does this make sense to you guys?

Please advice..

Best regards Michael

 

 

From here I would like to navigate to my 5 other EditScreens and collect data from 5 different topics.

It seems like I have to save my first FylliForm1 to the register so I can use the Patch command

Super User
Super User

Re: Navigate back to selected EditForm after submitting data.

I bet the problem is the Item property for the Form. What is it set to? 

 

My guess is you have it set  to Gallery1.Selected. And after you are submitting your form the first time PowerApps is refreshing your gallery. So the selected item is different. That is why you are seeing an old item.

 

What you can do is when they select an item in the gallery capture the ID to a variable. Now set the Form to Item to be Lookup(DataSource, ID = variableID)

 

Problem solved. 🙂 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
MRawmountain
Level: Powered On

Re: Navigate back to selected EditForm after submitting data.

Your'e totally right.. the Item property was set to BrowseGallery1.Selected.

I looked at your variabel video but couldn't find out how to capture the ID to a variable.

What is the formula to do that? I'm unfortunate still a newbie to this. I'm very grateful for your help.

/Michael

Super User
Super User

Re: Navigate back to selected EditForm after submitting data.

In the Gallery for OnSelect: Set(variableID, Gallery1.Selected.ID)

 

 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
MRawmountain
Level: Powered On

Re: Navigate back to selected EditForm after submitting data.

It didn't work as I hoped for.. please see my continuing problems.. attached a pdf w pics so the text below is easier to understand.

/Michael

 

Formula for BrowseGallery1 (OnSelect): Set(variableID; BrowseGallery1.Selected.ID)

+ - button (OnSelect)    (opens Forms for my 5 other input screens):

Formula:
NewForm(FylliForm1);;NewForm(FylliForm1B);;NewForm(FylliForm2);;NewForm(FylliForm3);;NewForm(FylliForm4);;NewForm(FylliForm5);; Navigate(FylliForm1; ScreenTransition.None)

 

Takes you to:   EditScreen1; FylliForm1

Red Submit-Button Formula:   “     SubmitForm(FylliForm1)    “

 

OnSuccess property for FylliForm1     (don’t know if this is correct)

“    Navigate(FylliForm1;ScreenTransition.Cover)    “

 

Item Property of FylliForm1    (something missing in the Formula below??)

“    LookUp(OSchemaTestOne; ID = variableID)   “

 

After pressing the Red Submit button nothing shows anymore… before I got at least the wrong object back ☹😊

Swedish message below: “No object to show”

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,995)