Forum Discussion
DeepLink to Viva connection to a specific SP page
To build a deep link to the Viva Connections application and then deep link to a specific SharePoint page that opens in the Viva Connections application, you can follow these steps:
-
Get the ID of the Viva Connections application:
- The ID of the Viva Connections application can be found in the Teams app manifest file or in the Teams admin center.
-
Configure the deep link to the Viva Connections application:
- Use the following format to configure the deep link to the Viva Connections application:
https://teams.microsoft.com/l/entity/<appId>/. - Replace
<appId>with the ID of the Viva Connections application.
- Use the following format to configure the deep link to the Viva Connections application:
-
Generate a deep link to the specific SharePoint page:
- To generate a deep link to a specific SharePoint page, you can use the SharePoint URL and append it to the deep link of the Viva Connections application.
- Make sure to properly URI encode the SharePoint URL and replace any special characters with their encoded values.
Here's an example of how you can generate the deep link:
var vivaConnectionsAppId = "<id of viva connection app>";
var sharePointPageUrl = "<URL of the specific SharePoint page>";
// Encode the SharePoint URL
var encodedSharePointPageUrl = encodeURIComponent(sharePointPageUrl);
// Generate the deep link
var deepLink = `https://teams.microsoft.com/l/entity/${vivaConnectionsAppId}/?webUrl=${encodedSharePointPageUrl}`;
// Open the deep link in the Viva Connections application
microsoftTeams.executeDeepLink(deepLink);
In the above example, replace <id of viva connection app> with the actual ID of the Viva Connections application, and <URL of the specific SharePoint page> with the URL of the specific SharePoint page you want to deep link to.
Make sure to properly URI encode the SharePoint URL using the encodeURIComponent() function to ensure that all query parameters and white spaces are encoded correctly.
By executing the generated deep link using the microsoftTeams.executeDeepLink() function, the Viva Connections application will open and navigate to the specified SharePoint page.
SaiPratap-MSFT
I can not get this to work.
This is how i did.
This is the result :
https://teams.microsoft.com/l/entity/00000000-0000-0000-0000-ee00425598aa/?webUrl=https%3A%2F%2Fcompany.sharepoint.com%2Fsites%2Fnat%2FSitePages%2FMySite.aspx
When i click on the link, it does open the viva connection app.
But it does not go to my sharepoint page on that site. So the link is still not a deeplink, it just goes to the application.
edit:
i also tried this in powershell
# Define variables
$vivaConnectionsAppId = "00000000-0000-0000-0000-ee00425598aa"
$sharePointPageUrl = "https://company.sharepoint.com/sites/net/SitePages/MyPage.aspx"
# Encode the SharePoint URL
$encodedSharePointPageUrl = [System.Web.HttpUtility]::UrlEncode($sharePointPageUrl)
# Generate the deep link
$deepLink = "https://teams.microsoft.com/l/entity/$vivaConnectionsAppId/?webUrl=$encodedSharePointPageUrl"
# Open the deep link in the default web browser
Start-Process $deepLink
I get the same result.
- SaiPratap-MSFTDec 21, 2023Former Employee
oskarkuus - is it only happening in power automate or does it happen if any app is bulid using ms teams js library(any tab or bot app) ?
- oskarkuusDec 26, 2023Brass ContributorI dont have the knowledge how to use ms teams js library with tab or bot app...
the url i want should be used within adaptive cards so a button can point the user to a page in viva connection app (sp site).
Navigating to the app itself (viva connection) works, but the deep linking to a SP site in the viva connection app does not work.- Prasad_Das-MSFTFeb 09, 2024
Microsoft
oskarkuus - Could you please let us know how you integrated/added your SP site page in Viva Connections app?
We added SP site page in Viva Connections app in 'Resources' section as below:
Then we tried to click on link: https://teams.microsoft.com/l/entity/d2c6f111-ffad-42a0-b65e-ee00425598aa It redirects to Viva Connections app.
When we tried to navigate to SP Page which we integrated using this link:
https://teams.microsoft.com/l/entity/d2c6f111-ffad-42a0-b65e-ee00425598aa/?webUrl=https%3A%2F%2Fm365x17798679.sharepoint.com%2Fsites%2FUSSales
It doesn't work. (In opens the app itself, doesn't navigate to particular page)
Are you trying in similar way?FYI, we tested this using New Teams desktop client.
- ChetanSharma-msftDec 22, 2023
Microsoft
Hello oskarkuus - Could you please let us know how you have integrated the SharePoint Site/page inside Viva Connections app?
If you have any test link (Encoded if possible), please share so that we can quickly test it from your end?- oskarkuusDec 22, 2023Brass Contributor
I am not sure what you are asking.
The Viva Connection app is in teams on the left menu
Navigating via URL to the app works. but not to a page on the sp site.
SP site link: https://company.sharepoint.com/sites/Intranat/SitePages/MyPage.aspx
Link to the app like this works: https://teams.microsoft.com/l/entity/d2c6f111-ffad-42a0-b65e-ee00425598aaBut the deep link i can not get to work.
https://teams.microsoft.com/l/entity/$vivaConnectionsAppId/?webUrl=$encodedSharePointPageUrl
Above become this: https://teams.microsoft.com/l/entity/d2c6f111-ffad-42a0-b65e-ee00425598aa/?webUrl=https://company.sharepoint.com/sites/Intranat/SitePages/MyPage.aspx
Clicking on this link just lead to the app, no deep-linking.Encoding above link gives this result:
https://teams.microsoft.com/l/entity/d2c6f111-ffad-42a0-b65e-ee00425598aa/?webUrl=https%3A%2F%2Fcompany.sharepoint.com%2Fsites%2FIntranat%2FSitePages%2FMyPage.aspx
But this link still just lands on the app, no deep-linking.
So the problem is not navigating to viva connection app, it is to get the app to display a specific page on that sharepoint site.