Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested actions does not work in MS Teams. #1465

Open
ms-86 opened this issue Nov 26, 2024 · 5 comments
Open

Suggested actions does not work in MS Teams. #1465

ms-86 opened this issue Nov 26, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@ms-86
Copy link

ms-86 commented Nov 26, 2024

I have checked NodeJS suggested actions example using Teams Toolkit extension after cloning samples repo on my laptop. Bot sends a welcome message and asks for a favorite color but suggested actions are not displayed as shown on a gif https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/bot-suggested-actions/nodejs/Images/BotSuggestedActionsGif.gif

Then I've download Teams App manifest https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/bot-suggested-actions/csharp/demo-manifest/bot-suggested-actions.zip and uploaded to my M365 developer tenant - behavior is exactly the same, suggested actions are not displayed. MS Docs is now inconsistent when it comes to this particular feature.
MS Teams Developer documentation suggests this feature is supported (here and here) but when you check Azure Bot Service docs you will see a None in a Suggested actions column for Microsoft Teams channel.

I have made a Python app as well which I run and test locally with Bot Framework Emulator, and what's interesting those suggested actions are displayed correctly there. After uploading the same app into Azure App Service with accompanying Bot Service and then verifying this in Bot Service Web chat those suggested actions are also displayed - the only issue is with Microsoft Teams.

image

@Prasad-MSFT
Copy link
Collaborator

Thanks for raising this issue. We already have an ICM raised for this, and engineering team is looking into it.
We will inform you once we get any further update from engineering team. Thanks!

@Prasad-MSFT Prasad-MSFT self-assigned this Nov 26, 2024
@Prasad-MSFT Prasad-MSFT added bug Something isn't working and removed needs-triage 🔍 labels Nov 26, 2024
@Prasad-MSFT
Copy link
Collaborator

@ms-86, according to latest update from engineering team, the fix has been merged. So please do verify at your end and let us know if you still encounter the issue.

@ms-86
Copy link
Author

ms-86 commented Jan 4, 2025

I will check this in a couple of days.

@ms-86
Copy link
Author

ms-86 commented Jan 21, 2025

I had some time to verify this. Now I can see cards when I chat through MS Teams but I have to admit behaviour is a little bit different and not something I expected to see after doing some tests with Bot Framework Emulator and Test in Web Chat, a feature of the Azure Bot service. Let me explain.

Here's my code for sending an activity with suggested actions:

from botbuilder.core import ActivityHandler, BotAdapter, MessageFactory, TurnContext
from botbuilder.schema import (
    ActionTypes,
    Activity,
    ActivityTypes,
    CardAction,
    ChannelAccount,
    Entity,
    InputHints,
    SuggestedActions,
)
class AiContextBot(ActivityHandler):
    async def on_message_activity(self, turn_context: TurnContext) -> None:
        """
        Handles incoming message activities, processes the message through the chain,
        and sends the response back to the user.

        Args:
            turn_context (TurnContext): The context for the current turn of conversation.
        """
        await turn_context.send_activity(
            Activity(
                type=ActivityTypes.message,
                text="What's your favorite color?",
                input_hint=InputHints.expecting_input,
                suggested_actions=SuggestedActions(
                    actions=[
                        CardAction(
                            type=ActionTypes.im_back,
                            title="RED",
                            value="r",
                        ),
                        CardAction(
                            type=ActionTypes.im_back,
                            title="GREEN",
                            value="g",
                        ),
                        CardAction(
                            type=ActionTypes.im_back,
                            title="BLUE",
                            value="b",
                        ),
                    ],
                    to=[turn_context.activity.from_property.id],
                ),
            )
        )
        return

You might have noticed that each CardAction has different values for type and value arguments and this is by design. When I run that code locally and test with Bot Framework Emulator, I can see that after pressing a button of the suggested action, a displayed text (title) is converted (value), the same thing with Test in Web Chat functionality of the Azure Bot service. But for some reason the same Bot behaves in a different way when talking through MS Teams - a value that is returned after user presses a button is always equal to title

Bot Framework Emulator
Image

Test in Web Chat (Azure Bot)
Image

MS Teams
Image

@Prasad-MSFT
Copy link
Collaborator

Yes @ms-86, your observation is absolutely correct and thanks for noticing this. We also observed the same and we have reached out to engineering team to confirm whether it is by design behaviour or a bug. Once we have any information, we will update in this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants