Deep Linking in Power Apps Canvas Apps
Deep linking in Power Apps Canvas apps allows users to navigate directly to specific screens or pass parameters to customize their experience. This functionality is essential for creating seamless, user-friendly apps.
What is Deep Linking in Canvas Apps?
Deep linking in Power Apps means creating URLs that:
- Open a specific screen in your app
- Pass parameters to customize the app’s behavior
For example, clicking a link might open your app to a “Details” screen and pre-fill fields with relevant data.
Key Concepts in Deep Linking
- App URL: Every Power Apps Canvas app has a unique URL, which can be extended with query parameters to enable deep linking.
https://apps.powerapps.com/play/<AppID>
- Query Parameters: Added to the app URL to specify actions or screens.
https://apps.powerapps.com/play/<AppID>?Page=Details&ItemID=123
Param()
Function: Retrieves values from the query parameters inside the app.
Implementing Deep Linking in Power Apps
Step 1: Use the App.StartScreen
Property
The App.StartScreen
property determines the initial screen when the app opens. It’s a better alternative to using App.OnStart
for navigation.
App.StartScreen = Switch(
Param("Page"),
"Details", DetailsScreen,
"Settings", SettingsScreen,
HomeScreen
)
Step 2: Retrieve Parameters Using Param()
Set(itemID, Param("ItemID"));
Step 3: Build Logic Based on Parameters
If(!IsBlank(itemID),
Filter(ItemsDataSource, ID = itemID),
ItemsDataSource
)
Creating Deep Links
- Base URL: Find your app’s URL from the Power Apps portal
- Add Parameters: Append query parameters:
https://apps.powerapps.com/play/<AppID>?Page=Details&ItemID=456
Testing Deep Links
- Publish the App: Ensure your app is up-to-date
- Use Test URLs: Open the constructed URLs in a web browser or Power Apps mobile app
Best Practices
- Use
App.StartScreen
instead ofApp.OnStart
for navigation - Implement default navigation when no parameters are provided
- Validate parameters and handle invalid values gracefully
- Test across browsers and the Power Apps mobile app
- Avoid exposing sensitive data in URLs
Example Use Cases
Pre-Filled Forms
If(!IsBlank(Param("UserID")),
Set(UserData, LookUp(Users, ID = Param("UserID")))
);
Custom Views
If(Param("View") = "Sales",
Navigate(SalesDashboardScreen),
Navigate(DefaultDashboardScreen)
);