Action.Submit postBack Behavior
I am wondering how to emulate the HeroCard postBack behavior with AdaptiveCards. I see in the documentation it says that "The data property of the action may be a string or it may be an object. A string is passed back to your bot as a Bot Builder SDK imBack activity, and an object is passed as a postBack activity"
My question is that with a HeroCard the postBack text is just a string but if I pass just a string to the data element for the AdaptiveCard it shows up in the Chat window and I don't want that. Is there anyway to have the AdaptiveCard behave like the HeroCard or will I have to modify my bot to accept an object instead of a string when matching on the postBack?
For anyone who encounters this issue in the future, the solution is as follows. As part of the data you have to include a flag which is set to true, and then you can set the value to the typical text as would be set in the HeroCard.
HeroCard: builder.CardAction.postBack(session, "show_All_Incidents", "View Incident(s)")
AdaptiveCard:
{
"type": "Action.Submit",
"title": "View Incident(s)",
"data":{"__isBotFrameworkCardAction": true, "type": "postBack", "value": "show_All_Incidents"}
}
Hi @jfb74 - can you file this issue in the WebChat repo?
@danmarshall I have closed the issue and provided the solution I found above, is there more you advise I should do?
@jfb74 If others want this behavior, then perhaps this should be a core feature :) so I would like to track it. Thanks for the feedback and contribution!
@danmarshall Luckily enough there is a solution which works properly now. Though it definitely would be good to have a more user friendly or more official solution on how to do this. I appreciate your response though!