Search code examples
botframeworkadaptive-cards

SuggestedAction with submit action functionality


Suppose there is an AdaptiveCard that contains some input fields like this. Normally the inputs made by the user are submitted as json by the AdaptiveSubmitAction which is part of the formular too.

Is there a way to submit the json data using a SuggestedAction? I suspect not, but I'm not sure...


Solution

  • Unfortunately, no, there is no way to mix the two. Additionally, the adaptive card requires the submit action when inputs are presented, otherwise, the text entered can't be ingested/accessed.

    Now, you could use the card for displaying what information you are seeking and use suggested actions to present possible answers. Unlike the choice prompt, suggested actions allows users to enter in alternate responses. Your bot logic would need to know how to handle alternate responses. Meanwhile, in the background, your logic could construct the user responses into a JSON object.

    I don't know if this was helpful. Hard to know without knowing your use case and specific needs.

    Hope of help!