I am using the Microsoft Bot Framework and Adaptive cards to have user fill out a form. The form is being created and displayed correctly, but now I am trying to add the ability for users to go back and edit fields of the form (some fields are auto-populated on form creation in certain situations.)
Here is what my card currently looks like (in the Bot Emulator):
Before Quote Name is input
After Quote Name is Entered
I want my card to look like this after I add the edit functionality:
Edit Quote Name
Where the user can click the "Edit" text (which is a textblock in its own column) and have a new TextInput field appear under the "Edit" text as a new inline card. Here is the code I have tried:
new ColumnSet()
{
Columns =
{
new Column()
{
Size = "2",
Items =
{
new TextBlock()
{
Text = "Edit",
Color = TextColor.Accent
}
},
SelectAction = new ShowCardAction()
{
Title = "View",
Card = new AdaptiveCard()
{
Body = new List<CardElement>()
{
new TextBlock()
{
Text = "In the Edit Card",
Weight = TextWeight.Bolder
}
}
}
}
}
},
}
I think the problem is with the ShowCardAction() not working as I expect it to. When I replaced this with an OpenURLAction() a new link was opened when the 'Edit' text was clicked on (so this action worked, but ShowCard didn't).
I referenced this post Adaptive Cards - Nested scheme and the adaptive cards schema explorer here but haven't had any luck.
Has anyone done something like this before and is willing to share how they did it?
Currently SelectActions can only be used with Action.OpenUrl and Action.Submit, as you've observed. I will update the docs to make this more obvious. We do hope to explore adding show card support in the future but need to to get the UX right on every platform.