How do I parse the submit action value in Adaptive cards? I know am somewhere near but unable to resolve it. If I type a text manually, I move forward to the new dialog in the waterfall model
Cards.json
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"id": "textBlock",
"text": "CREATE AN INCIDENT. "
},
{
"type": "Input.Text",
"id": "username",
"placeholder": "Enter your email address"
},
{
"type": "Input.Text",
"id": "shortdescription",
"placeholder": "Enter a short description"
},
{
"type": "Input.Number",
"id": "phonenumber",
"placeholder": "Enter your phonenumber"
}
],
"actions": [
{
"type": "Action.Submit",
"id": "submit",
"title": "Submit",
"data":{
"action": "mychoices"
}
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
RequestDialog.cs
var askforSelectionSteps = new WaterfallStep[]
{
askForSelection,
askForSelectionResult,
CreateTicketFor_InstallSoftware
};
public async Task<DialogTurnResult> askForSelection(WaterfallStepContext sc, CancellationToken cancellationToken)
{
_state = new GenericRequestState();
await _accessor.SetAsync(sc.Context, _state);
//return await sc.PromptAsync(choiceprompt, new PromptOptions()
//{
// Prompt = MessageFactory.Text("Can you please let me know if the request is for you or someone else?"),
// Choices = new List<Choice> { new Choice("MySelf"), new Choice("Someone Else") },
// RetryPrompt = MessageFactory.Text("Please enter MySelf or Someone Else."),
//});
return await sc.PromptAsync(TextPrompt, new PromptOptions()
{
Prompt = CardHelper.GenericRequestIncidentChoices(sc, cancellationToken),
});
}
public async Task<DialogTurnResult> askForSelectionResult(WaterfallStepContext sc, CancellationToken cancellationToken)
{
var isSuccess = sc.Result.ToString().ToLower();
if (isSuccess == "incident" || isSuccess == "inc")
{
//return await sc.BeginDialogAsync(GenericRequestationStep_OneId);
return await sc.PromptAsync(TextPrompt, new PromptOptions()
{
Prompt = CardHelper.GenericCreateIncident(sc, cancellationToken),
});
}}
I have looked into some of the samples and stackoverflow itself but am not able to pass the submit action back to the dialog. Any help would be appreciated!