Adaptivecards: Action open.Url to message in Teams goes to wrong channel

Created on 15 Aug 2019  路  9Comments  路  Source: microsoft/AdaptiveCards

Platform

Microsoft Flow Action - Post an adaptive card to user as Flow Bot

Author or host

I am adding the JSON for the adaptive card to the flow action to post the message

If you're an author, who are you sending cards to?
The Adaptive Card is sent as a personal message to a specified user in the Flow Action

Issue

The Flow I created is triggered by a new message in a Team Channel (not the General channel). The web url of the message is parsed out of the trigger JSON.
A message alerting a user about the post is sent to the user with the Post an adaptive card to user as Flow Bot. In the JSON, there is a text block that gives the URL:

  {
            "type": "TextBlock",
             "text": "[View Message](@{body('Parse_JSON')?['webUrl']})"
   }

I also added an action to open the message url:

    "actions": [
        {
            "type": "Action.OpenUrl",
            "title": "View message in channel",
            "url": "@{body('Parse_JSON')?['webUrl']}"
        }

The message gets posted successfully in Teams:

AdaptiveCardMessage

If I click on the "View Message" URL - it tries to open it in a browser which then sends the user back to Teams to the message from the URL.

If I click the "View message in channel" action, the user stays in Teams, but is redirected to the message Team's General channel and most recent message - not to the message associated with the URL.

Ideally, I should get a combination of the two behaviors - stay in Teams and go to the right channel/message. If that is not possible, then the Action Open.URL should be the same as clicking the message URL so that the user ends up at the right place.

Bug no-recent-activity

All 9 comments

Thanks @maryha, this may be an issue in Flow. I'm looping them in and will let you know as soon as I hear back

@maryha It seems to me that you are using the right link. Although I didn't Parse the JSON, and just used the trigger body function since my action starts 'when a message is posted' ( triggerbody()?['webUrl']).

I did a little research, and was able to see the message highlighted using the hyperlink manually from the browser. Could you try it using the web browser as well and let me know if that works better?

Lastly, please let me know what you would like to happen when you press the button. I'll continue to work with you once I understand your goal a bit better. (Did you know you have an action in Flow that will post a response to a message? This would put you in context of the original conversation automatically.)

Thank you for your patience,
Audrie

P.S. I found some guidance here:
https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/deep-links#deep-linking-to-a-chat

@matthidinger We may need your help with the submit action. When I run the flow, then pull the output with the link I get different experiences:

  1. Manually pasting the link into the browser will redirect to teams, and highlight the trigger message in yellow.
  2. Manually pasting the link into a conversation (and sending the conversation), then clicking on the link does the same thing as above (highlighting the source message in yellow, which fades quickly)
  3. However, when I press the button with the link within the body of the adaptive card it just blinks the screen (like a quick post back).

sampleFlow_20190821203319.zip

@audrieMSFT ,

Whether I am using the Teams desktop client or using Teams in a browser, the behavior is exactly the same.

Clicking the "View Message" link in the main text opens the link in a new browser window, asks if I want to view it in the Web or in the Teams app and then takes me to the message either in the browser or in the Teams app depending on my selection. It is just a little annoying that I am already in Teams (either the app or the browser) when I click the link, and the link always takes me to a new browser window which then takes me back to Teams - but to the right message.

When I click the action button, I don't leave Teams at all (which is nice), but I don't end up at the message I expected. I can right-click and get the text link, but I don't know of a way to get the action button link.

If helpful, this is the JSON produced by Flow sent to my Chat in Teams:

{ "type": "AdaptiveCard", "body": [ { "type": "TextBlock", "size": "medium", "weight": "bolder", "text": "Keyword Found - bot" } , { "type": "TextBlock", "text": "[View Message](https://teams.microsoft.com/l/message/19%3A996e35f41e4047709cdb0f409b79faf0%40thread.skype/1565881792072?groupId=e9521925-2e11-4617-ab66-957301f96190&tenantId=3d44f5c7-726e-45cd-b26c-3e58cddea376&createdTime=1565881792072&parentMessageId=1565881792072)" } ], "actions": [ { "type": "Action.OpenUrl", "title": "View message in channel", "url": "https://teams.microsoft.com/l/message/19%3A996e35f41e4047709cdb0f409b79faf0%40thread.skype/1565881792072?groupId=e9521925-2e11-4617-ab66-957301f96190&tenantId=3d44f5c7-726e-45cd-b26c-3e58cddea376&createdTime=1565881792072&parentMessageId=1565881792072" } ], "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.0" }

This issue has been automatically marked as stale because it has not had any activity for 5 days.

Hello,

Can we re-open this request? We've determined this is not something that's related to the Flow App. We're actually building an adaptive card through the Graph API now and noticing some inconsistent behavior. Specifically, it appears MS Teams handles opening the same URL differently if posted a couple of different ways in the same message. What's even stranger is the behavior I'm seeing today is different than it was just 24 hours ago.

Below are the 3 ways we're trying to link to a channel in a different team.

  1. Within an adaptive card, using Action.OpenUrl, posted via graph API
  2. Within an adaptive card, creating linkable text (i.e. channel-abcd) through HTML, posted via graph API
  3. Outside of the adaptive card, long hyperlink (https://teams.microsoft.com...)

We are specifically testing a use case where the user clicking the link IS NOT part of the team we're redirecting to.

Last night's behavior
Windows Desktop Client

  1. Action.OpenUrl -- redirects me to the General channel of the first team listed in my sidebar under "Your Teams"
  2. Linked text -- redirects me to a Chrome web browser, when I click "Open Microsoft Teams," I am redirected to the "join team" workflow which presents me with an option to join the team that's hosting the channel I want to link to
  3. Link outside of the adaptive card -- brings me directly to the "join team" workflow WITHIN the MS Teams client -- this is the desired behavior in a case where the user is not a member of the Team

Mobile Client -- Triggered the "join team" workflow for all 3 cases above

Today's behavior
Desktop Client -- exactly the same behavior as what's been posted above for all 3 types of links
Mobile Client -- today, this redirects to a page within the client that lists the channel name at the top of the page and message saying "You're no longer a member of this team." The "join team" is no longer triggered in any of the 3 case cases. This is problematic for the use case we're trying to solve for. I'm hoping there's a workaround or some other way to get this link to trigger the "join team" workflow as it was doing last night!

Please let me know if there are any other details I can provide.

Hi @maryha. We have acknowledged this issue report. Please continue to follow this issue for updates/progress/questions.

I am having the same problem. My Adaptive Card includes a deep link to a Teams tab, but it still opens in a new web browser rather than in the Teams App. If I send the same link as a regular chat and not in an adaptive card, the deep link works fine and directs the user to the tab in the Teams app.

We ended up implementing a workaround by posting the channel's link above the Adaptive Card so it looks a bit like a header. Not ideal but it works how we expect it to. If you're able, it might be worth giving it a shot, until the developers can look into what's happening here.

Was this page helpful?
0 / 5 - 0 ratings