Microsoft Bot Framework FormFlow Confirm

FormFlow is an awesome feature of Microsoft Bot Builder designed to let you easily create a form filling experience in your bot. There’s a lot of good official documentation but here’s one trick I found by checking the actual code (which it actually open source on GitHub )

In this article I’m going to focus on the Confirmation message that should be displayed at the end of the flow.

At its base, the you configure the form flow by just calling the Build() method on the FormBuilder class.

1
return new FormBuilder<SandwichOrder>().Build();

At the end of the flow, you will get a default confirmation message that includes all your fields and their values:

If you want to customize that message you need to start overriding the Build() method as such:

1
2
3
4
return new FormBuilder<SandwichOrder>()
.AddRemainingFields()
.Confirm("Are you sure?")
.Build();

  • not really what you’d want. We still need to see the values we’ve selected.

In order to get the default message whilst still be able to customize it you can use the special {*} formatting option:

1
2
3
4
return new FormBuilder<SandwichOrder>()
.AddRemainingFields()
.Confirm("Are you sure? Here are your current selections: {*}")
.Build();

Share Comments