Deep-linking in Microsoft Power Apps

Vrutika Gaikwad
IntelliconnectQ Engineering

--

Deep-linking is providing a link that will land the user straight to a specific screen rather than the user navigating to that screen from the home screen(viz. the usual landing screen when you share a power apps link).

For example:

The below image is an email sent for a PowerApps application, it lists items of monthly expense that are maintained using the PowerApps application.

There is a link for each item in the list. This link will take the user directly to the Item Details page in the application.

Implementing deep-linking in PowerApps

Step 1: Designing the app

Create a PowerApps application connect it with a data source (in this example, ‘Expense tracker’ SharePoint list) and display the data in a gallery. Add a Checkbox inside the gallery and a Share icon on top as shown in the image below.

Set the Share icon’s OnSelect property as follows:

Add a container and set if Fill property to the color of your choice. Add two Text inputs, two buttons, and an HTML Text control. Arrange them as shown below.

Set the Container’s Visible property to varPop

Step 2: Create an HTML table with Item links

Set the HtmlText property of HTML Text control as given below: Make an HTML table using Concat() and add the ID of each Item as a parameter to your App link along with the Screen

Example of URL in href of anchor(<a>) tag:

{App Link}&Screen=Details&ItemID=1

Here Screen and ItemID are parameter names and are case-sensitive. Details is a parameter value for Screen and 1 is a parameter value for ItemID.

Set the Sent button’s OnSelect and DisplayMode properties as given below:

Setting the DisplayMode property in this manner will ensure that the Send button is not enabled until the User input’s a valid email address in the top text input.

Set the Cancel button’s OnSelect property as given below:

Step 3: Identify parameters while starting the app and act accordingly

Set App’s OnStart and StartScreen as given below:

OnStart of the app check if there is any ItemID Parameter passed in the link of the app while opening. If yes then fetch that record from the Data source and Set it as a global variable.

Check if there is any Screen Parameter passed in the link of the app while opening. If yes then Navigate to ScreenItemDetails(a screen that will directly show the item details)

Add another screen to your application. Insert a Display form in it and Set the form’s Item property to the global variable set in the OnStart.

Notes:

  • There can be more than one parameter in your link, but make sure to not add too many functions and processing on the OnStart property (it will slow down your app start)
  • Param() can be combined with Launch() to connect your different PowerApps applications
  • The Screen parameter can have more values than just one. And those can be added to link based on conditions too.
  • User can also be restricted to one screen only by maintain a Access control list or table.

References:

--

--