Cannot get subEntityId on MS Teams tab app on button click

Sahi Repswal 161 Reputation points
2021-07-06T08:12:14.653+00:00

I have a card having buttons and on click on button, It is switching the tab and in url I have context having subEntityId. But I am not able to get subEntityId in context. Below is my JSON:

"content": {
                    "title": "Test Button",
                    "text": "Test Button",
                    "buttons": [
                        {
                            "type": "openUrl",
                            "title": "Edit",
                            "value": "https://teams.microsoft.com/_#/tab::4f09546f-4adb-4395-87ec-86378e31fe72/Test?threadId=19:47f98dafd1924912bc65d9fca24703fe@thread.tacv2&ctx=channel&action=EditDeal&itemId=341708&context=%7B%22subEntityId%22%3A341708%2C%22action%22%3A%22EditDeal%22%7D"
                        }
                    ]
                } 

Can you please help me to find out the cause of this?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,016 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,260 questions
{count} votes

Accepted answer
  1. Hunaid Hanfee-MSFT 981 Reputation points
    2021-07-08T16:05:45.75+00:00

    Hello,
    Can you please try to build your link this way:
    Encoded:

    https://teams.microsoft.com/l/entity/<app-id>/<entity-Id>?context=%7B%22subEntityId%22:%22<subEntityId>%22,%22channelId%22:%22<channelId>%22%7D  
    

    Decoded:

     https://teams.microsoft.com/l/entity/<app-id>/<entity-Id>?context={"subEntityId":"<subEntityId>","channelId":"<channelId>"}  
    

    Important notes:

    • Please make sure that you are entering the correct entityId.
    • channelId is not required in case of static tabs.
    • Please have a look at Create deep links and Get context for your tab.
    • If issue isn't resolved, please let us know.

    Thanks,

    Hunaid


    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.