Use Case:
I was building a very complex PowerApps (Canvas) screen that included too many controls and that has affected my screen and app performance. One of the recommendations that PowerApps provided is to break the App into multiple apps and I did exactly that. Then I had to build the mechanism to navigate back and forth between my main app and the new app and that is why I am writing this blog.
So our Use case is that we have two PowerApps applications and we need to navigate from one app to another and go back and forth between the two.
I will name my first application APP A and my second application APP B.
Design:
APP A
APP B
In the OnSelect property of Navigate to APP B Screen One button:
Launch("YOUR-APP-B-URL&Landing=ScreenOne",Blank(),LaunchTarget.Replace)
NOTE: I added the & character to the end of the URL along with my Param "Landing" and its value "ScreenOne", in the next section, we will see how we initiate the Param and its values and how we will get APP B to navigate to which screen based on the Param value.
In the OnSelect property of Navigate to APP B Screen One button:
Launch("YOUR-APP-B-URL&Landing=ScreenTwo",Blank(),LaunchTarget.Replace)
NOTE: I added the & character to the end of the URL along with my Param "Landing" and its value "ScreenTwo", in the next section, we will see how we initiate the Param and its values and how we will get APP B to navigate to which screen based on the Param value.
In the APP B App StartScreen property, I added the following formula:
Switch
(
Param("Landing"), //Initialize the name of the Param
"ScreenOne", //The Value we are passing from APP A along with URL
ScreenOneAppB, //This is Screen One Name
"ScreenTwo", //The Value we are passing from APP A along with URL
ScreenTwoAppB //This is Screen Two Name
)
Also, in APP B, both screen Home Icon OnSelect Property, add the following code:
Launch("YOUR-APP-A-URL",Blank(),LaunchTarget.Replace)
NOTE: here we won't add Param value as we want to navigate to the Start Screen in APP A.