anonymous user I think editing of the choices is restricted for the choiceSet from the client side. You can try a different way to take the inputs like inputs with validation and restrict the number of choices to the ones that are only required and others as optional along with show cards.
Can i edit Adaptive card Choices dynamically? If yes how?
I have an Input.ChoiceSet in my adative card. I want to edit the choices and may the number of choices reduced after editing. How can I edit the card and reduce the number of choices and change the choice values?
3 answers
Sort by: Most helpful
-
romungi-MSFT 48,531 Reputation points Microsoft Employee
2020-08-18T12:56:27.85+00:00 -
Paul Smoothy 6 Reputation points
2021-11-05T02:29:53.88+00:00 Not sure which part you mean @Baum, Joel (J) , but this is how I get a list of items
Then this is how I use the variable in the JSON of a Teams adaptive card.
The output is from the Compose where the list of items from my previous post are collected, but the first "," stripped off to make it valid JSON.Hope that helps.
-
Paul Smoothy 6 Reputation points
2021-05-09T23:17:32.067+00:00 Hi K,
I'm not sure if this is what you were exactly asking for, but it may be tailored for your situation.
I wanted to make a dynamically created set of choices in an adaptive card and get a user response.
This is how I did it.
Loop through list items to get the data I wanted, then for each item verify that it is correct (for me I wanted to make sure I didn't collect any that had missing information so I checked for "null" value and if it was null then do nothing. If Flow found a value that should be included then append to a string variable code like this:
Then after looping through all the values I used a Compose (substring(variable), 1) to remove the leading "," and that left me with valid JSON to insert into the choices section of the adaptive card.
Hope that helps, though you may already have figured it out.
Regards,
Paul