Showing results for 
Search instead for 
Did you mean: 
Level 8

Back() function not working properly please help

Back() function not working properly:

I have 1 screen and that screen have one button of to create new record which redirects to another screen.


On that another screen I have written patch function to create record and after that I have written Back function.


It was working fine till this morning but at now I am facing this issue:

on first screen I have 3 records, I am opening third one then from that screen I am selected new record button which redirects to new screen, I am filling all information and creating record using patch function. After this code I have written "Back(ScreenTransition.Fade)".

It should navigate me to the screen and should display me third records detail, but it is displaying me by default always "first record" details.


I have tried to create new screen and write all the things again but it does not working.


Please help.

Level 10

Re: Back() function not working properly please help



you can use navigate too

Level 8

Re: Back() function not working properly please help

I have tried it, its not working properly.


It navigates back but displaying wrong information - It is displaying first record's details on screen instead of displaying selected record's details by default.

Level 8

Re: Back() function not working properly please help

This is probably to do with the Default of your gallery and not with the Back() function. If you change something in the datasource used in the Gallery, it will select the default item again.


Level 8

Re: Back() function not working properly please help

the screen which is not displaying proper information is having "Edit Form" and its "Item" property is set to "BrowseGallery_1.Selected". So it should display the selected record fields on that edit form.


It is displaying for 1 to 3 seconds correct information and after that 1 to 3 seconds it is changing information and displaying first records details on that Edit form. That information is auto refreshing.

Super User
Super User

Re: Back() function not working properly please help


As @Sofie_D suggested, your issue is more likely with the Gallery default and that it is getting changed, thus causing the EditForm Item property to use the newly selected default value, which is record 1.

What is your Default property on your Gallery like?  Also, the Items property on the you have anything going on in there that might cause the issue.


To make a quick resolve (which will not resolve the default selected item in the Gallery), you can use a variable instead of the Selected item.

On the OnSelect action of your Gallery, put this formula -  Set(currentItem, ThisItem)

Then, change the Item on your Form to currentItem


Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Community Support Team
Community Support Team

Re: Back() function not working properly please help

HI @rajmilansinh ,

Do you list your data source records within a Gallery?


Based on the issue that you mentioned, I agree with @Sofie_D 's thought almost. When you use Patch function to add new item into your data source, your data source would be refreshed, so your Gallery would be refreshed/reset.


As an alternative solution, you could consider take a try to save the selected item in your Gallery into a variable, then use that variable within your Edit form.

I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the Gallery to following:

Set(CurrentSelectedItem, ThisItem)

Set the Item property of your Edit form to following:


Please take a try with above solution, then check if the issue is solved.


Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Level 8

Re: Back() function not working properly please help

Hello @v-xida-msft, I have implemented this way and its working fine but I have another issue which still remains same.

And that is connected with this issue.

So I provide details here:

First screen having 3 records.

I open third one.

Second screen shows selected record's edit screen.

On second screen I am having 1 button for creating new lookup record for the current entity.

By that button I am navigating to Third Screen which is having fields of another entity's to be filled.

When I fill all information on third screen and submit the form, what I expect when I go to second screen - there is one lookup field which should display the newly created record's name which was I just created from the third screen.

So by default it was not showing newly created record there, so I had written Refresh('DataSet') function so that I can get newly created record on that lookup field.

It was working fine till I had no issue with the back function.

I faced the issue which I have mentioned on the post.

Then I tried your solution, It was sucess to get the selected record details on the second screen but now I am failing to get newly created record on that lookup field on second screen even there is already Refresh('DataSet') function written.

I also tried to remove that refresh function and test the application but though I have same issue.


Hope you can understand the all details.

Let me know if you want more details here.

Helpful resources

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 Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.


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 (10,160)