0
votes

I'm using FormFlow in bot framework. What is the best way to store the user's input differently after he answers a question?

For instance, I would like to ask "What is your name" and then store only the first word before the next whitespace.

1

1 Answers

0
votes

I found the answer. Validate can be used for that purpose (see this, "Adding Business Logic" section)

Here's an example of how I did it:

.Field(nameof(ClusterName), validate: (state, value) => Task.FromResult(new ValidateResult
                {
                    Value = state.GetFirstName((string)value),
                    IsValid = true
                }))