Forum Discussion
MSTeams Navigating to a page inside a tab using deeplink and context object of msteams JS
There are 2 fundamental issues using the msteams deeplink concept for the tab.
1. Lets consider a scenario, where the msteams tab is hosting a webapp which consists of the homepage and several other internal pages. So, the homepage URL is basically what is added in the configuration setting of the app. So, everytime the tab is clicked, the homepage for that tab is rendered.
Issue: Using the deeplinking documentation of MSTeams, the context & subentityId is successfully used to redirect to the internal page. But what actually happens is
a) First it partially renders the homepage
b) Then it navigates to the desired internal page.
So, for a user, it feels like the navigation is not smooth.
- Is it possible, that using deeplinking concept, and using the context object & subentityId value, we can directly navigate to the internal page other than the homepage, so that the navigation feels smoother
2. Once the internal page is rendered, if I use a link to go to the homepage, then it doesn't allow me to render home page. I have to reload the tab and then the home page is rendered. The issue I guess is that the context object is not reset after the navigation to the internal page.
- Is it possible, that we can somehow reset the context object after the navigation to deeplink is complete ?
- Prasad_Das-MSFTMicrosoft
satyan2142 - Thanks for reporting. We are checking this issue at our end. We will get back to you with our findings.
- Prasad_Das-MSFTMicrosoft
satyan2142 - We tried to repro the issue at our end, however on navigating to a page inside a tab using deep link, it gets redirected to specific internal page smoothly without rendering homepage first.
The same happens while returning back to home page as well. Reloading tab is not required.Link to a task item within the configurable tab:
https://teams.microsoft.com/l/entity/fe4a8eba-2a31-4737-8e33-e5fae6fee194/tasklist123?webUrl=https://tasklist.example.com/123/456&label=Task 456&context={"subEntityId": "task456","channelId": "19:cbe3683f25094106b826c9cada3afbe0@thread.skype"}
Thanks,
Prasad Das
---------------------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
- satyan2142Copper Contributor
Hi Prasad_Das-MSFT. Thanks for the quick response
Can you please let me know the steps that you used to navigate to a different page within a tab using the context object.
Steps I am following:
In the homepage html, waiting for the microsoftTeams.app() to get initialized.
Once initialized, getting the value from the context object, using app.getContext() and then by calling the window.open(url) function of plain JS to navigate to the different page depending on the context value. Let me know if these are the right steps to follow.- Prasad_Das-MSFTMicrosoft
satyan2142 - We are also following similar procedure. In the homepage html, waiting for the microsoftTeams.app() to get initialized. Once initialized, getting the value from the context object, using app.getContext() and then calling microsoftTeams.app.openLink(url); function to navigate to the different page depending on the context value. Referred below sample:
Microsoft-Teams-Samples/samples/tab-deeplink/nodejs at main · OfficeDev/Microsoft-Teams-Samples (github.com)Thanks,
Prasad Das
--------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.