Skip to main content

Notifications

Community site session details
Power Apps - Building Power Apps
Answered

Identify Previous Screen For Back Button (Alternative to "back ()" Function)

Like (0) ShareShare
ReportReport
Posted on 26 Mar 2022 17:26:17 by

Hello everyone, 

 

I currently have an app with a Back button on a screen that holds a glossary of 3D objects. The button uses the "back ()" function to navigate to the previous screen. This button works in edit mode, but will not work when using the published app from a computer, tablet, or phone. The page will display a "page not responding" message after trying to execute for a while, probably due to the large amount of 3D objects the screen holds. I can't use a simple "Navigate (X page)" function, because the user will be accessing the glossary from different screens, and won't be returning to the same screen each time.

 

So, I am looking for a solution to the problem, perhaps creating a global variable or a collection to somehow identify the previous screen? I am VERY new to PowerApps, so any help with this would be greatly appreciated!

  • Verified answer
    Pstork1 Profile Picture
    66,091 Most Valuable Professional on 26 Mar 2022 at 18:02:51
    Re: Identify Previous Screen For Back Button (Alternative to "back ()" Function)

    If you make a collection of objects that has the previous screen and an ID or keyname at startup you can then save the current screen ID when you navigate to another screen.  Then use a lookup on that ID to go back.

    #in OnStart
    ClearCollect(myScreens,{id:1,Screen: Screen1},{id:2,Screen: Screen2},{id:3,Screen: Screen3})
    
    #OnSelect to navigate to screen 2
    Navigate(LookUp(myScreens,id=2).Screen,ScreenTransition.Fade);Set(BackScreen,LookUp(myScreens,Screen=Screen1).id)
    
    #OnSelect to navigate back
    Navigate(LookUp(myScreens,id=BackScreen).Screen,ScreenTransition.Fade);

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started
Loading started