Forum Discussion
MSTeams Navigating to a page inside a tab using deeplink and context object of msteams JS
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.
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.
- satyan2142Jan 18, 2023Copper Contributor
Prasad_Das-MSFT
I tried the microsoftTeams.app.openLink(url). But its opening the page outside the app in a separate tab of the browser. I am using currently MSTeams browser webapp. Is it possible that, the page will be opened inside the msteams tab itself, and doesn't open other browser tab
ThanksSatya
- Prasad_Das-MSFTJan 20, 2023
Microsoft
satyan2142 - Could you please provide your deep link url you are using?
Whether you choose to expose your tab within the channel or group, or personal scope, you must present an <iframe> HTML content page in your tab.