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

  1. 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>
  1. Query Parameters: Added to the app URL to specify actions or screens.
   https://apps.powerapps.com/play/<AppID>?Page=Details&ItemID=123
  1. 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
)
  1. Base URL: Find your app’s URL from the Power Apps portal
  2. Add Parameters: Append query parameters:
   https://apps.powerapps.com/play/<AppID>?Page=Details&ItemID=456
  1. Publish the App: Ensure your app is up-to-date
  2. Use Test URLs: Open the constructed URLs in a web browser or Power Apps mobile app

Best Practices

  1. Use App.StartScreen instead of App.OnStart for navigation
  2. Implement default navigation when no parameters are provided
  3. Validate parameters and handle invalid values gracefully
  4. Test across browsers and the Power Apps mobile app
  5. 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)
);