[FormFlow] Warning, that selected field is wrong choice, when try to change field value
Pre-flight checklist
- [ ] I posted a question about this issue on Stack Overflow using the tag
botframework. - [x] I have searched the existing issues before logging a new one.
System Information (Required)
- SDK Platform: C#
- SDK Version: 3.8.1
- Development Environment: localhost
Issue Description
I made FormFlow dialog with two fields. When testing if I want to change any field, I press corresponding button and get warning, that selected field is wrong choice. It heppen on russian locale.
Example Code
My class
public class GetInfoForm
{
[Describe("фамилия")]
[Pattern(@"^[\s\S]+$")]
public string SecondName { get; set; }
[Describe("имя")]
[Pattern(@"^[\s\S]+$")]
public string FirstName { get; set; }
public static IForm<GetInfoForm> BuildForm()
{
return new FormBuilder<GetInfoForm>()
.Message("Заполните необходимые данные для получения информации")
.Build();
}
}
Method in MessagesController class
public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
{
if (activity.Type == ActivityTypes.Message)
{
await Conversation.SendAsync(activity, () => { return Chain.From(() => FormDialog.FromForm(GetInfoForm.BuildForm)); });
}
else
{
await HandleSystemMessageAsync(activity);
}
var response = Request.CreateResponse(HttpStatusCode.OK);
return response;
}
Expected Behavior
The suggestion to enter a new value for the field.
Actual Results
I've confirmed this behavior is repeatable using en-US. Still investigating.
I'm not sure that this is a bug.
In fact, the problem here is that you need to define TermsAttribute for the matching, DescribeAttribue is not used for this (it is used for the display in your form):
https://docs.microsoft.com/en-us/dotnet/api/microsoft.bot.builder.formflow.termsattribute?view=botbuilder-3.8
If Terms are not set up, the code is automatically trying to generate some terms (see here in code: https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Microsoft.Bot.Builder/FormFlow/FieldReflector.cs#L375) using the name of the field:
_terms = new TermsAttribute(Language.GenerateTerms(Language.CamelCase(name), 3));
For example in your case, terms will be: seconds? + name+ seconds? name for SecondName field.
Adding [Terms] attribute resolves the issue. However we trying to resolve this without having [Terms] attribute.


Bug Fix has been submitted. Closing this thread.
Great, thanks.