Most of the time we are adding navigation via an icon in the top navigation, or a button push such as a "Next" prompt. In those cases, it is very easy to auto-build our navigation formulas by selecting the object which will be the trigger, and using the Action Menu to add navigation.
Tip: Did you notice that you can select the screen and the transition directly from the Navigation drop downs on the Action tab? When you do that PowerApps builds the navigation formula for you! Easy peezy!
A slightly different scenario:
On the other hand, there are times when we want to determine navigation based on user selection somewhere on the current screen. In the sample below, we built a ficticious sample app which returns feature statistics for our sprint. In addition, it allows the Program Managers to suggest new features (driven by customer EBC) by clicking on the small push pin on the lower right hand corner of the screen.
Here's the catch: Each Product has a different set of field values required to suggest a feature....so a different form is needed based on the product selection (enablement often leads to diversity in intake systems - smiles). Therefore, we have a different request screen in the app for each product name.
Not to worry! This is an exceptionally easy thing to do in PowerApps. The way I choose to do it is by setting the OnSelect property for the push pin icon in this way:
Step 1: Select the Push Pin Icon
Step 2: Set the OnSelect property with a conditional format similar to this one (change the screen names and drop down names as needed):
If("A" in ddProductName.Selected.Value,Navigate(ScreenProductA, ScreenTransition.Fade),
If("B" in ddProductName.Selected.Value,Navigate(ScreenProductB, ScreenTransition.Fade),
Translated the above formula really means:
If "A" is found in the selected Product Name then navigate to the screen named "ScreenProductA", or if "B" is found in the selected Product Name then navigate to the screen named "ScreenProductB", ELSE navigate to the screen named "ScreenProductC").
Any operator can be used (such as equals) instead:
If(ddProductName.Selected.Value="Product A",Navigate(ScreenProductA, ScreenTransition.Fade),
If(ddProductName.Selected.Value="Product B",Navigate(ScreenProductB, ScreenTransition.Fade),
The If() function is a handy tool for many types of conditions including navigation. I've written it completely out here for the sake of readability, but you can abbreviate nested "If" statements as broken down in our formula reference here:
I hope this mini-blog helps you to enjoy, and to enhance your PowerApps today!