How to customize validation messages in Bot framework form flow? Below is the sample code I'm working where if the user type any text other than the options provided I need to give them the choice list back saying that the option chosen is not correct.
[Prompt("Please choose # category... {||}", ChoiceStyle = ChoiceStyleOptions.Buttons)]
public string Category;
[Prompt("Please choose # sub category... {||}", ChoiceStyle = ChoiceStyleOptions.Buttons)]
public string Subcategory;
[Prompt("We need some more details to create the request, provide me your **contact number**...")]
[Pattern(Validations.Phone)]
public string ContactNumber;
[Prompt("Please provide **Attachement** if you don't have attachemnt please enter ? {||}")]
public ChoiceOptions? Attachment;
Currently, if the option is not on the list it simply throws a message like
' Userinput is not a contact/attachment/category option'
Jobin, you want to look at the more advanced features of formFlow. You can create business logic around your fields by using field validation functions. This is a sample of what that looks like taken from MS Online docs. You can see the full sample and docs here I find that this method way of creating my form is much more flexible than using attributes.