CardAction
Object
There isn't really any documentation on using CardAction
with a ChoicePrompt
because ChoicePrompts
aren't really "meant" to be used this way. It's possible, but not really preferred.
Here's the reference for the CardAction
Class:
DisplayText
Gets or sets (Optional) text to display in the chat feed if the button is clicked
Image
Gets or sets image URL which will appear on the button, next to text label
Text
Gets or sets text for this action
Title
Gets or sets text description which appears on the button
Type
Gets or sets the type of action implemented by this button. Possible values include: 'openUrl', 'imBack', 'postBack', 'playAudio', 'playVideo', 'showImage', 'downloadFile', 'signin', 'call', 'payment', 'messageBack'. More on ActionTypes
Note: ChoicePrompt expects a imBack
ActivityType, so using other types can have some odd results.
Value
Gets or sets supplementary parameter for action. Content of this property depends on the ActionType
Title vs. Text
Given the CardAction
:
new Choice()
{
Action = new CardAction()
{
Type = "messageBack",
Value = "ACTION VALUE",
Title = "TITLE",
Text = "TEXT",
},
Value = "CARD VALUE",
});
This will produce:

When clicked:

So, Title
is the text displayed on the button. Text
is the text send back to the bot as a message. If Value
is present in the CardAction
, it gets sent as the activity's value
.
The Bug
I see that you submitted this question to GitHub, as well. I'll just duplicate the response here.
The issue isn't so much that you can't have a null Choice.Value
so much as when extracting Choice
s from the CardAction
and trying to determine the max length of the text to display for the Choice, ChoiceFactory
was incorrectly looking at Choice.Value
while it's null instead of looking at Choice.Action.Title
. See PR for the fix, there.