I would like to present the user with a series of choices, but also allow them to type in freeform text. The Choice prompt will automatically reprompt until a choice or synonym is chosen.
The RecognizerOptions NoValue and/or NoAction appear to be related to this, but I haven't been able to find good documentation on them. Setting them to true doesn't work.
AddDialog(new ChoicePrompt(promptForChoice) { RecognizerOptions = new FindChoicesOptions() { NoValue = true, NoAction = true } });
I've also tried creating an "anything" validator that always returns true.
AddDialog(new ChoicePrompt(promptForChoice, validator: AnythingValidator.AnythingValidatorAsync) { RecognizerOptions = new FindChoicesOptions() { NoValue = true, NoAction = true } });
public static Task<bool> AnythingValidatorAsync(PromptValidatorContext<FoundChoice> promptContext, CancellationToken cancellationToken)
{
return Task.FromResult(true);
}
This allows the prompt to exit, but the result is null. I can go dig out what the user entered from the Context.Activity.Text but that doesn't seem like a very robust solution.
There seems to be something obvious I'm missing with PromptChoice