How to capture Hyperlink click

Anonymous
2022-07-29T15:10:16.833+00:00

I have designed an adaptive card Where I have defined a link Click on the link to get more detail . It will open in new tab . Action to capture if someone has clicked on the link How It can be done ? 226167-screenshot-2022-07-29-at-92733-pm.png

Here is Payload for Adaptive card :

{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "Image",
"url": "photoURL",
"size": "Small"
}
]
},
{
"type": "Column",
"width": "stretch",
"selectAction": {
"type": "Action.OpenUrl",
"url": "https://www.servicenow.com/"
},
"items": [
{
"type": "TextBlock",
"text": "Click on the link",
"wrap": true,
"size": "Large",
"color": "Accent",
"weight": "Bolder"
}
]
}
]
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Now that we have defined the main rules and features of the format, we need to produce a schema and publish it to GitHub. The schema will be the starting point of our reference documentation.\n",
"wrap": true
}
]
}
]
}

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
845 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,345 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sayali-MSFT 2,746 Reputation points Microsoft Vendor
    2022-08-03T11:25:34.317+00:00

    Could you please tryout like below Adaptive Card JSON-

    {  
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",  
        "type": "AdaptiveCard",  
        "version": "1.0",  
        "body": [  
          {  
            "speak": "Tom's Pie is a pizza restaurant which is rated 9.3 by customers.",  
            "type": "ColumnSet",  
            "columns": [  
              {  
                "type": "Column",  
                "width": 2,  
                "items": [  
                  {  
                    "type": "TextBlock",  
                    "text": "PIZZA"  
                  },  
                  {  
                    "type": "TextBlock",  
                    "text": "Tom's Pie",  
                    "weight": "bolder",  
                    "size": "extraLarge",  
                    "spacing": "none"  
                  },  
                  {  
                    "type": "TextBlock",  
                    "text": "4.2 ★★★☆ (93) · $$",  
                    "isSubtle": true,  
                    "spacing": "none"  
                  },  
                  {  
                    "type": "TextBlock",  
                    "text": "**Matt H. said** \"I'm compelled to give this place 5 stars due to the number of times I've chosen to eat here this past year!\"",  
                    "size": "small",  
                    "wrap": true  
                  }  
                ]  
              },  
              {  
                "type": "Column",  
                "width": 1,  
                "items": [  
                  {  
                    "type": "Image",  
                    "url": "https://picsum.photos/300?image=882",  
                    "size": "auto"  
                  }  
                ]  
              }  
            ]  
          }  
        ],  
        "actions": [  
          {  
            "type": "Action.OpenUrl",  
            "title": "More Info",  
            "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"  
          }  
        ]  
      }  
    

    Also got one related thread.
    https://stackoverflow.com/questions/62428562/how-to-capture-action-of-hyperlinks-of-adaptive-card-in-c-sharp
    Hope it's helpful.


  2. Sayali-MSFT 2,746 Reputation points Microsoft Vendor
    2022-08-05T11:26:07.647+00:00

    Currently there is no way to capture the hyperlink event.

    If you are using the Action.OpenUrl, show the given url either by launching it in an external web browser or showing within an embedded web browser. it will open in new tab.

    If you try with Action.Submit is sends an event to the client/bot but not opening the link. It is up to the client to determine how this data is processed.
    For example: With BotFramework bots, the client would send an activity through the messaging medium to the bot. The inputs that are gathered are those on the current card, and in the case of a show card those on any parent cards.

    Could you please help by suggesting this feature on - Microsoft Teams · Community

    Thanks,
    Sayali


    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.


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.