cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IdreesAnwar
Frequent Visitor

Deep Link Canvas app embedded as a tab using the SubEntityId parameter directs to the incorrect location

I'm currently attempting to implement deep linking within a canvas app which is embedded as a tab in a channel. I have followed an approach which was shown in the video here:  https://www.youtube.com/watch?v=TwrwTAa1ePQ 

 

I'm currently sending a link containing the Unique identifier for an object called Opportunity. Within my app I have an Icon, when clicked, a link to the tab containing the canvas app is posted to the channel that the app is embedded in. In this link the value of SubEntityId has been changed from null to the value of Opportunity.Opportunity. the OnSelect code for the icon looks like this .

 

If(IsBlank(MicrosoftTeams.PostMessageToChannelV3(
"60a4acaf-b5c9-41f9-9d84-3859567b0c8c",
"19:9fc6a2d4b0924f04bc14a0c9109c7c46@thread.tacv2",
{
content: "<h1>" & User().FullName & " is sharing the following opportunity via the innovation tracker</h1><br></br>
<a href='https://teams.microsoft.com/l/entity/a6b63365-31a4-4f43-92ec-710b71557af9/_djb2_msteams_prefix_3989559343?context=%7B%22subEntityId%22%3A" & selectedOpportunity.Opportunity &"%2C%22channelId%22%3A%2219%3A9fc6a2d4b0924f04bc14a0c9109c7c46%40thread.tacv2%22%7D&groupId=60a4acaf-b5c9-41f9-9d84-3859567b0c8c&tenantId=27b2553d-4a89-4c74-88e1-d1d590624294'
>" & selectedOpportunity.Name & "</a>",
contentType:"html"
}
)),
Notify("There was an issue sharing the Opportunity to the team", NotificationType.Error),
Notify("The Opportunity has been successfully shared", NotificationType.Success))

 

Here's an example of one of the links that was posted: https://teams.microsoft.com/l/entity/a6b63365-31a4-4f43-92ec-710b71557af9/_djb2_msteams_prefix_39895... 

 

The subEntityId parameter has the value: 4ff2e68b-1adb-eb11-bacb-000d3adb55b9

 

This piece of code successfully posts the link to the embedded power apps tab containing the subEntityId value to the channel. but when the link is clicked, the user is not taken to the embedded power app at all and is instead taken to the Power apps app within teams (the place where canvas apps are built). I haven't been able to work out why this is happening, 

 

I have also tried it with the Opportunity.Name field instead of the Oppoortunity.Opportunity field to see if the issue persists and the issue does still occur.

 

Here's  the OnStart code that I have written for the app:

 

Set(deepLinkItem, Text(Param("subEntityId")));
If(
    !IsBlank(deepLinkItem),
    Notify("Deep link detected: " & deepLinkItem);
    Set(selectedOpportunity, LookUp(Opportunities, Text(Opportunity) = deepLinkItem));
    Set(newOpportunity, false);
    Set(returnPage, 'Opportunity List Page');
    Navigate('Opportunity Details Page', ScreenTransition.None);
);

 

Can anyone help with some guidance on this?

1 ACCEPTED SOLUTION

Accepted Solutions
IdreesAnwar
Frequent Visitor

I have managed to find out why it wasn't working. The subEntityId parameter does not seem to allow anything other than numbers. To get the deep linking working, I created an Autonumber column in the Opportunity object with a starting value of 1000. I then used that column to set the value of the subEntityId parameter and changed the on start code to use the Autonumber column I had just created in the lookup. After doing this, I no longer had the issue and the deep linking worked. 

 

PS. The subEntityId parameter also doesn't seem to allow numbers prefixed with zero i.e. 0001. 

View solution in original post

1 REPLY 1
IdreesAnwar
Frequent Visitor

I have managed to find out why it wasn't working. The subEntityId parameter does not seem to allow anything other than numbers. To get the deep linking working, I created an Autonumber column in the Opportunity object with a starting value of 1000. I then used that column to set the value of the subEntityId parameter and changed the on start code to use the Autonumber column I had just created in the lookup. After doing this, I no longer had the issue and the deep linking worked. 

 

PS. The subEntityId parameter also doesn't seem to allow numbers prefixed with zero i.e. 0001. 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,246)