To display holiday list city wise, i am creating an adaptive card. On adaptive card there will be one drop down with list of cities, based on selection I need to show holiday list for selected city. I am not able to find how to fetch selected value from the drop down. I tried something like below, but it is giving me the very first value only which i selected in drop down while rendering card-
var card = new AdaptiveCard();
try
{
card = new AdaptiveCard(new AdaptiveSchemaVersion(1, 0))
{
Body =
{
new AdaptiveTextBlock("My Holiday List - " + userCity),
new AdaptiveTextBlock("Please select city:"),
new AdaptiveChoiceSetInput
{
Choices = list,
Id = "CountryOrganizationCode",
Style = AdaptiveChoiceInputStyle.Compact,
Value = "Delhi",
// IsMultiSelect = false,
},
},
};
card.Actions = new List<AdaptiveAction>
{
new AdaptiveShowCardAction
{
Title = "View Holiday List ",
Type = "Action.ShowCard",
Card = new AdaptiveCard(new AdaptiveSchemaVersion(1, 0))
{
Body =
{
new AdaptiveTextBlock()
{
Text = holidaylist.Where(i => i.Key == ((AdaptiveCards.AdaptiveChoiceSetInput)card.Body[2]).Value).FirstOrDefault().Value.ToString(),
Wrap = true,
},
},
},
},
};
}
From my answer to the other question:
You can only extend Adaptive Card functionality if you're using Web Chat so you won't be able to respond to events from this dropdown and you won't be able to modify the card as the user is filling it out. You'll need to have the user select a city and then click the submit button. While Teams does allow message updates and so you could update the card in response to the submit action, it's probably better and easier just to send a whole new card with the holiday list.
What this means is that you'll only be able to do what you're trying to do in Web Chat, and even then it will be difficult. Since you'll need a workaround for Teams, you might as well just use that workaround for Web Chat too.
You won't be able to get Adaptive Cards to work in Skype because it's not one of the supported platforms for Adaptive Cards. Skype bots in general are also deprecated, so my recommendation is to drop Skype as a channel and just use the other two.