botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

suggest default values

Open rlilov opened this issue 10 years ago • 4 comments

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#

rlilov avatar May 25 '16 08:05 rlilov

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.)

chrimc62 avatar May 25 '16 22:05 chrimc62

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) => . . ..

rlilov avatar May 26 '16 16:05 rlilov

We should probably add some parameters to FromForm, but it is easy work around. Instead of FromForm, do new FormDialog(, VEMDATA.BuildForm, FormOptions.PromptFieldsWithValues).

chrimc62 avatar May 26 '16 19:05 chrimc62

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).

rlilov avatar May 27 '16 15:05 rlilov