microsoft / microsoft/AdaptiveCards
[Feature Request] ChoiceSet options should dynamically change subsequent ChoiceSet options, or at least, toggle visibility of other ChoiceSets
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Problem Statement
I am trying to implement a basic, form submission capability using an Adaptive Card. This capability I would argue is a minimum expectation from any online form, where the chosen option of one drop-down input dynamically alters the available options for a subsequent input.
Currently, a solution like this is only possible by sending a user multiple adaptive cards. This is not ideal, as this means that we require one adaptive card per dynamic ChoiceSet. For even a small form this immediately becomes bad user experience. Additionally, submitting a form is supposed to be quick and easy, whereas this introduces prolonged wait times between a user submitting an adaptive card to a bot, and waiting for the next card to be sent back.
Consider an example where a bot allows users to report an issue. This form needs to capture as much detail as possible with minimal effort from the user. The values chosen in the first ChoiceSet determine the options presented in the following ChoiceSet.
Audio related issue
Video related issue
Breaking this out across two adaptive cards (realistically more as this is just a small example) is really unpleasant. Adaptive Cards should be adaptive and should support basic form submission features.
I do also want to quickly mentioned that during my research, this idea has been suggested many times over the past few years. It is evident that others have been in my position and would like this feature implemented.
Proposed solution
I don't have a detailed solution to this. One possibility could be to have something to toggle the visibility of ChoiceSets by checking what has been selected in a different ChoiceSet, e.g.: "$when": "${$root.issueTypeChoiceSet == \"Audio\"}"
Alternatives or Workarounds
As mentioned above the only workaround is to break a form out into multiple adaptive cards (One for each dynamic ChoiceSet) which is not ideal
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the ChoiceSet behavior and the proposed "$when" expression in the issue. Define how one ChoiceSet should change later options or toggle their visibility without sending multiple Adaptive Cards. Done means the supported form flow can handle the Audio and Video examples within a single card.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100