cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
msv
Helper I
Helper I

Back and Navigate showing wrong screen

Hello

 

I have 3 screens. First one has gallery, second one has Edit screen and 3rd one is also an Edit Screen.

 

Setup:

I am using back icon and on form success property in screen 3 so that when I click the back icon or if the form is successful in 3rd screen it goes back to the previous screen/screen 2 that I opened. This works if the form is in new mode

 

I am using global variable on startup to set the form mode to New or Edit, EntryTypeVar=New or EntryTypeVar=Edit. I use this to avoid NewScreen and Edit Screen.

 

Issue:

But if I open the edit record from screen 1 to screen 2 and then click on a button in screen 2 that takes me to screen 3 and then click some other record in screen 3 and click back icon or submit button then it goes to the wrong screen or some random submitted recorded screen

 

Trials:

I tried using navigate function and it does the same thing, issue persists. 

 

Bottom line:

Screen 3 is like a sub screen of Screen 2 and it depends on Screen 2. But when I play with Screen 3 or browse records in Screen 3 Gallery and try to go back to Screen 2 it does not show the screen that I initially opened but some random submitted record/screen.

 

6 REPLIES 6
Jacky_Shen
Resolver IV
Resolver IV

Hi @msv ,

 

Please check the "Item" property of screen 2 and screen 3, I guess your "Item" property in your screen 2 is set to "Screen1Gallery.Selected"; and for screen 3, if the record is related to the data in screen 2, that means it has a relationship between the data source in screen 2 and screen 3, please use LookUp to find the record for your screen 3 if the relationship is 1 to 1.

Drrickryp
Super User
Super User

Hi @msv 

What are you using for a datasource? if SharePoint, is this just a data entry form or a complete app?

Thanks for your reply. I am using If(EntryTypeVar="New",Defaults('[dbo].[PowerApp_PCD_Data_Entry]'),EntryTypeVar="Edit"MainGallery.Selected) for screen 1 items property where Main Gallery is on MainScreen not Screen 2 or Screen3. I dont have foreign key or referential integrity in the data source, however if the value does not exist when entered on Screen 2, I am creating it on Screen 3 and then using it back on Screen 2.




Thanks for your reply @Drrickryp. I am using Azure SQL Server as the data source, yes it is form based app that has 3 screens, each screen has a different purpose

Drrickryp
Super User
Super User

@msv 

Assuming a 3 screen app with one datasource , one gallery (Gallery1) and 2 edit forms (Form1 and Form2).  The two forms have the same datasource as the gallery.  If this is correct, you are saying that you want to use a different record on Form2 than Form1 as it has a different purpose but it is still the same record.  My suggestion would be to use the gallery as the "traffic cop" and direct the user to the form depending on the purpose. Thus, when the user is done with a form, that they return to the gallery to decide where to go next.  The screenshot shows three screens with different purposes but they are all based on the same fictitious contact list.  The gallery has two icons, the building has its OnSelect property  EditForm(Form1); Navigate(Screen2)  The person icon has its OnSelect property EditForm(Form2); Navigate(Screen3)_1.png

 

 

The + button above the Gallery has its OnSelect property: NewForm(Form1); Navigate(Screen2).  It is assumed that the company will be added first. 

The OnSuccess property of both forms is Navigate(Screen1).  This scenario sends the user back to the gallery to decide what to do next, either choose another record to modify or add the contact to the new record or create another new record. 

 

msv
Helper I
Helper I

@Drrickryp Thank you so much for your valuable reply. Unfortunately my app design is not in the way mentioned above. I have a form1 in Screen1(table 1 is the data source) which checks for a value in table 2(same db as table1) that is the datasource for form2 and if it is not available the user can add that value in form2, once the value is created successfully, it appears in the gallery of screen2 and the user is directed back to form 1 to submit form 1 in screen1

If the navigation is linear or straightforward in case of above activity for a new entry then I dont have any issues. However if the user tries to check the submitted entries in screen 2 gallery that also has form2 then navigate back to screen1/form1 then it shows a different submitted entry which is unrelated. This is my issue

In screen2 I have form2 and gallery in the same screen as I dont want to create multiple screens with multiple navigation and the form2 has only 4 fields to submit so it is a short form

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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