Closed ChernHwee closed 1 year ago
@ChernHwee - I was able to repro the issue successfully. When I take the adaptive card code and put it in the Developer Portal's Adaptive Cards editor, it marks all the action.toggleVisibility
action types as invalid suggesting action.submit
instead. Curiously, putting the card into the Adaptive Card's Designer also shows the same when testing against Teams.
I believe this to be a Teams specific issue. I'm guessing that the Designer relies on Teams code in order to accurately represent Teams look and functionality which would explain why the warning shows in both places. I haven't verified this to be true, however.
I'm checking to see what next steps might be and will get back to you with an update.
@stevkan any update on this?
That action isn't supported in Teams. You can find the list of supported actions here: https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-actions?tabs=json#adaptive-cards-actions.
As an alternative, you can use Action.ShowCard: https://adaptivecards.io/explorer/Action.ShowCard.html
Thanks, I will try out Action.ShowCArd. Note: this action was supported in Teams previously. When the action/functionality is not supported please advise on how to fix it in error for backward compatibility.
@clearab But Action.ToggleVisibility is among the Action types of Adaptive Card: https://adaptivecards.io/explorer/Action.ToggleVisibility.html
I do not believe that action was ever supported in Teams. The documentation listed above shows which actions are supported on their client. Every location that chooses to support Adaptive Cards has the option to support, override, or otherwise alter the behavior of the cards on that particular client. Most clients restrict some portion of the full Adaptive Cards protocol/schema in some manner - in general it is always best to check the documentation for the particular client you're sending cards to in order to ensure your card will work correctly.
If you'd like to discuss this further, I would suggest reaching out to the Teams group directly using one of the methods outlined here: https://learn.microsoft.com/en-us/microsoftteams/platform/feedback.
@clearab Thanks for the clarification and for pointing me to the right direction. TBH, I feel Adaptive Card should expedite its pace for new features and adoption by all clients. In our case, we use AD extensively in our Teams app. The hope is for it to replace 90+% use of other js based UI SDK.
The dependency is a bit the other way around, Teams is choosing which portions of the AC schema and protocol to support. Adaptive Cards doesn't really have a lot of control over that portion.
However, almost all the focus currently is around full support for Action.Execute, as it is a single action which can reproduce essentially all of the functionality of the other actions. If you're investing heavily in adaptive cards (which is awesome, because adaptive cards are awesome), I'd recommend focusing on fully understanding and using Action.Execute - https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/universal-actions-for-adaptive-cards/overview
Closing as resolved.
Describe the bug
In the Microsoft teams application when I click the toggle visibility button, it displays as usual but the adaptive card shows "Something went wrong. Please try again." Initially, I suspect it is my code issue but when I ran the example it still shows "Something went wrong. Please try again."
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
It should not show "Something went wrong". Please try again
Screenshots