Introduction
Microsoft Power Apps provides several built-in functions that help developers create interactive and user-friendly applications. Two commonly used functions are Navigate() and Launch().
Although both functions are used to move users from one place to another, they serve different purposes.
Navigate(): Used to move between screens within the same Power Apps application.
Launch(): Used to open external resources such as websites, email links, and other applications.
Understanding the difference between these functions helps developers build better navigation experiences and improve application usability.
1. What is Navigate() in Power Apps?
The Navigate() function is used to move from one screen to another within the same Canvas App.
It is particularly useful when developing multi-screen applications where users need to move between screens such as Home, Details, Dashboard, and Settings.
Syntax:
Navigate(ScreenName, ScreenTransition)Example:
Navigate(Screen2, ScreenTransition.Fade)In this example:
Screen2 is the destination screen.
ScreenTransition.Fade applies a fade transition when moving to the destination screen.
Passing context variables using Navigate()
You can also pass context variables while navigating between screens.
Navigate(
Screen2,
ScreenTransition.Fade,
{
SelectedEmployee: Gallery1.Selected,
IsEditMode: true
}
)In this example, the selected employee record and edit mode value are passed to Screen2.
You can access these context variables directly on the destination screen.
Common use cases:
Moving between multiple screens.
Opening employee or customer details.
Passing selected records between screens.
Implementing form navigation.
Creating smooth screen transitions.
2. What is Launch() in Power Apps?
The Launch() function is used to open external resources from a Power Apps Canvas App.
For example, if you want to open a website, send an email, or launch another Canvas App, you can use the Launch() function.
Syntax:
Launch(URL)Example 1: Opening a website
Launch("https://www.microsoft.com")When the user clicks the button, the Microsoft website opens in the browser.
Example 2: Opening an email link
Launch("mailto:[email protected]")This opens the default email application with the specified email address.
Example 3: Opening another Power Apps application
Launch(
"https://apps.powerapps.com/play/your-app-link"
)This launches another Canvas App using its web link.
Passing parameters using Launch()
You can also pass parameters when launching another Canvas App.
Launch(
"https://apps.powerapps.com/play/your-app-link",
{
InvoiceID: 101,
Mode: "Edit"
}
)In the destination app, retrieve these values using the Param() function.
Param("InvoiceID")To convert the invoice ID into a number:
Value(Param("InvoiceID"))Common use cases:
Opening external websites.
Redirecting users to documentation.
Opening email links.
Launching another Canvas App.
Passing parameters between applications.
Microsoft documentation: Launch and Param functions.
3. Practical Example: Navigate() vs Launch() in an Invoice Approval App
Let's understand both functions with a real-world Invoice Approval application.
Imagine you have an application with three screens:
Home Screen
Invoice List Screen
Invoice Details Screen
Scenario A: Navigate to Invoice Details
When a user selects an invoice from the gallery, you want to open its details screen.
Set the gallery's OnSelect property:
Navigate(
scrInvoiceDetails,
ScreenTransition.Fade,
{
SelectedInvoiceID: ThisItem.ID
}
)On the Invoice Details screen, you can use:
SelectedInvoiceIDThis allows users to view the selected invoice details without leaving the application.
Scenario B: Launch an external website
Suppose the user wants to open the vendor's website from the Invoice Details screen.
Set the button's OnSelect property:
Launch(
"https://www.microsoft.com"
)The website opens outside the current app screen.
Scenario C: Open an email application
Suppose the user wants to contact the finance team.
Launch(
"mailto:[email protected]?subject=Invoice%20Approval"
)This opens the default email application with the recipient and subject populated.
4. Key Differences Between Navigate() and Launch()
Feature | Navigate() | Launch() |
|---|---|---|
Purpose | Internal navigation | External resource launching |
Destination | Screen within the same app | Website or another app |
Screen transition | Supported | Not applicable |
Context variables | Supported | Uses launch parameters |
Website opening | No | Yes |
Email links | No | Yes |
Multi-screen applications | Yes | Not its primary purpose |
Function type | Behavior function | Behavior function |
5. Important Tips for Power Apps Developers
Here are some important points to remember when using these functions.
1. Use Navigate() for internal navigation
When moving between screens in the same Canvas App, always use Navigate().
2. Use Launch() for external resources
When opening websites, email links, or another Canvas App, use Launch().
3. Pass only the required information
When navigating between screens, pass the necessary context variables. When launching another app, pass the required parameters.
4. Consider application performance
Avoid launching unnecessary external resources. Also, save important application state before launching another app when that information needs to be preserved.
5. Use StartScreen for the initial screen
For setting the first screen when an app starts, use the App object's StartScreen property rather than using Navigate() in App.OnStart.
6. Common Mistakes to Avoid
Mistake | Recommended approach |
|---|---|
Using Navigate() to open a website | Use Launch() |
Using Launch() to move between internal screens | Use Navigate() |
Forgetting to pass required parameters | Pass parameters explicitly |
Not converting Param() values | Use Value() when numeric values are required |
Using Navigate() in App.OnStart to select the initial screen | Configure StartScreen |
Conclusion
Both Navigate() and Launch() are important functions in Power Apps development, but they serve different purposes.
Use Navigate() when you want to move users between screens within the same application.
Use Launch() when you want to open external websites, email links, or another Canvas App.
Understanding these functions will help you create better navigation experiences, improve application usability, and build more efficient Power Apps solutions.
Remember: Navigate() means moving within your app, while Launch() means opening an external resource.







Join the conversation! Your thoughts help the community grow.