0
votes

I am building a chat bot using Bot Framework, C# Bot Builder and FormFlow (with FieldRelfector). At one step I need to ask an open question to the user like "Add any other relevant information", where I just want to collect some text and store it for later usage. I tried to define the variable as String:

    [Prompt("Add any other relevant information")]
    public string OpenText;

In the form chain I have:

    .Field(new FieldReflector<MyForm>(nameof(OpenText))
                        .SetType(null)
                        .SetActive(state => !state.Finished()))

but that doesn't help, whatever I type the bot answers:

   "blah blah" is not a open text option.

How to handle this?

1

1 Answers

0
votes

Is there any reason you are using a FieldReflector for that property? I would suggest just defining a normal field for that property (you can have a form with fields defined with FieldReflector and fields defined just with Field).

Just use:

.Field(nameof(MyForm.OpenText), state => !state.Finished())

If there is a reason to use FieldReflector, please update the post with the entire form definition.