0
votes

I am using Bot Framework .Net SDK v4 adaptive card v1.2. I am using waterfall design to show cards in each step of waterfall. But user is able to click buttons from previously shown cards and this makes the bot look dumb.

How can I disable/Hide adaptive card buttons from previous chat in bot framework in c#?


1
You need to update the prior sent cards manually afaik. But Kyles answer there should help aswellTim Cadenbach
Thanks for the reply. I understand that we need to send the id of button in card data that can be fetched in the activity payload. But how do I disable the submit button, something like getElementById("SubmitButtonId").style.display = none in C#? in node js and java script it will work but what about c#. And what is bot state ?(There is a way to effectively disable Adaptive Card submit actions in any channel using bot state.)quest
What channel are you using? (Since there are multiple other people in this thread, you will need to @ mention me if you want me to see your reply.)Kyle Delaney
@quest - Are you still working on this?Kyle Delaney

1 Answers

0
votes

Web Chat has a sample that shows you how to disable Adaptive Cards on the client side: https://github.com/microsoft/BotFramework-WebChat/blob/master/samples/05.custom-components/l.disable-adaptive-cards/index.html

If you want to disable cards on the bot side then you'll need to use bot state to remember which cards are still clickable. You can read about bot state here: https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-concept-state

I'm working on a library that can do this for you automatically. You can voice your support for the library if you want it to be released sooner. The page currently contains no fewer than 9 links to issues just like yours where people want to disable cards: https://github.com/BotBuilderCommunity/botbuilder-community-dotnet/issues/137