Introduction
A deep link is important when you need to navigate the user to a specific record or a screen through a link. Here we will create a deep link through Power Automate and send it via email. The recipient can click on that deep link to directly navigate to a particular PowerApps screen.
So, in this article we will learn below points:
- How to add your app to the team channel tab?
- How to get an App link?
- How can we create a deep link and how this can be sent via email?
Step 1 - Sign in to the Microsoft Teams
Step 2 - Create an App in Teams PowerApps
Add PowerApps from the left pane of the teams by clicking 3 dots.
Select the Team, and select the existing app or create a new app.
For a demo purpose, here I have created one new app named Travel Request management in the Travel Request management team.
Step 3 - Add an app to the team channel tab
- Click on PowerApps from the left pane of teams.
- Select the Build tab and then select the team in which you have created your app.
- Click on See all.
Click on the 3 dots of the app and select Add to teams.
Click on Add to Teams button.
Then it will open a popup, in this popup, we can add the app directly in the left pane of teams by clicking Add button, also on clicking the down arrow button we can Add to teams or Add to a chat.
But here I have clicked on Add to teams option.
For adding an app type, a team or channel name and select a team and click on the Set up a tab button.
Click on the Save button.
Select a team or channel and click on + icon.
Once you click on the + icon then you can see all the default apps and those you have added previously. Then select your app and then click on the Save button.
Step 4 - Get an App link
Select a team or channel and click the arrow icon from the above tabs of the app tab.
Then select Copy link to tab and you will get the link to the app then convert this link to decode the URL and use this URL as a deep link.
For example, here is my Encode URL (Copy link to tab)
Decode URL
Step 5 - Create an app link and send it via email
- We can use this decoded URL in the email body.
- Add your required parameters in subEntityId with some random charters.
- Here I have used AAAZZZ.
Now, let’s add the redirection logic in PowerApps as below:
1. In my case I have the below screens.
2. Add a logic as ClearCollect(ParametersCol,Split(Param("subEntityId"),"AAAZZZ")); On Visible of the first screen (Here my first screen is SplashScreen)
ClearCollect(ParametersCol,Split(Param("subEntityId"),"AAAZZZ"));
3. On the Splash screen, add one timer control, and on that add the below logic on the OnTimerEnd property.
//Check if the deep link has parameters
If(CountRows(ParametersCol)>0,If(!IsBlank(First(ParametersCol).Result)&&!IsBlank(Last(ParametersCol).Result),UpdateContext({VarRequestID:First(ParametersCol).Result});Navigate(OperationScreen,ScreenTransition.Fade,{BackTo:DashboardScreen});ViewForm(Form1);Set(varorder,LookUp('Travel Requests',ID=Value(VarRequestID))),If(!IsBlank(First(ParametersCol).Result),UpdateContext({VarRequestID:First(ParametersCol).Result});Navigate(OperationScreen,ScreenTransition.Fade,{BackTo:DashboardScreen});ViewForm(Form1);Set(varorder,LookUp('Travel Requests',ID=Value(VarRequestID))),Navigate(DashboardScreen))),Navigate(DashboardScreen));
4. If you see the below URL I have passed the request ID as 31, thus the user will navigate to the Operation screen, where he can see the details of request ID 31.
Conclusion
In this article, we have learned how to create a deep link in team PowerApps.