suggest default values
When user finishes interacting with my bot I store his entries in my db for further processing. When he restarts using the bot (same conversation) chances are that for the first 2 questions he will need to supply same values he supplied in previous chat. i have them stored in database
Do I have a way to suggest to him those values (to avoid typing) and he can either type over to amend or simply hit send to send them?
i am using FormFlow and c#
It is great you are doing this--exactly the kind of thing a good bot should do. Yes, you can pass in an instance of your state to when you construct FormDialog which also takes a FormOption.PromptFieldsWithValues if you want to confirm the default. (Otherwise the step will be skipped if you have a value.)
I am trying to figure out how I can pass the instance of state? here is how I am creating the dialog (more or less like in AnnotatedSandwichBot) return Chain.From(() => FormDialog.FromForm(VEMData.BuildForm, FormOptions.PromptFieldsWithValues)) .Do(async (context, order) => . . ..
We should probably add some parameters to FromForm, but it is easy work around. Instead of FromForm, do new FormDialog(
Thanks, this worked ! Hopefully last question I am storing the 2 fields that I consider candidates for PromptFieldsWithValues in the .Do in the context.PerUserInConversationData databag
I can not figure out where and when to retrieve them in order to pass them as parameter to new FormDialog(savedcolumns, VEMDATA.BuildForm, FormOptions.PromptFieldsWithValues).