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

FormOptions New Enum Value Required

Open kevinport opened this issue 10 years ago • 17 comments

With the FormOptions None and PromptFieldsWithValues the user have to trigger the dialog start. It would be nice if we can use a new option PromptFieldsWithValuesInStart, that the user doesn't have to trigger the dialog start with an unnecessary message to the bot

kevinport avatar Sep 18 '16 15:09 kevinport

Microsoft.Bot.Builder.cs

if (this._options.HasFlag(FormOptions.PromptInStart) || this._options.HasFlag(FormOptions.PromptFieldsWithValuesInStart)) { await MessageReceived(context, null); } else { context.Wait(MessageReceived); }

kevinport avatar Sep 18 '16 15:09 kevinport

@willportnoy, thoughts?

dandriscoll avatar Sep 18 '16 15:09 dandriscoll

@kevinport are you suggesting that leveraging the flag nature of the enum when calling FormDialog doesn't do what you want?

i.e. FormOptions.PromptInStart | FormOptions.PromptFieldsWithValues

willportnoy avatar Sep 19 '16 01:09 willportnoy

@willportnoy Your suggestion FormOptions.PromptInStart | FormOptions.PromptFieldsWithValues workes perfectly. In this case we don't need to extend the FormOptions Enum.

In my opinion both solutions will work, and the user doesn't have to trigger the dialogstart with an unnecessary message to the bot.

kevinport avatar Sep 19 '16 09:09 kevinport

Thank you :+1: when is this feature available?

kevinport avatar Sep 19 '16 19:09 kevinport

One note for clarification: works if (this._options.HasFlag(FormOptions.PromptInStart) || this._options.HasFlag(FormOptions.PromptFieldsWithValues)) { await MessageReceived(context, null); } else { context.Wait(MessageReceived); }

doesn't work: if (this._options.HasFlag(FormOptions.PromptInStart | FormOptions.PromptFieldsWithValues)) { await MessageReceived(context, null); } else { context.Wait(MessageReceived); }

kevinport avatar Sep 20 '16 19:09 kevinport

@kevinport I wasn't sure about the resolution of this thread - are you suggesting a code change is needed in FormFlow to check both flags?

willportnoy avatar Sep 20 '16 21:09 willportnoy

Yes i am suggestioning a code change in formflow.

because if you use "PromptFieldsWithValues" you have to send an unnessensary message to the bot to start the conversation.

kevinport avatar Sep 21 '16 20:09 kevinport

@chrimc62 what do you think?

willportnoy avatar Sep 22 '16 16:09 willportnoy

The current functionality seems fine.

chrimc62 avatar Oct 05 '16 03:10 chrimc62

@chrimc62

Can you tell me how to use the option "PromtFieldsWithValues"?

In my case the dialog did Not Start until you send a Message the bot. If you doesnt know this, the user thinks the bot got an error.

kleeporten avatar Oct 05 '16 17:10 kleeporten

@kleeporten you would normally use FormOptions.PromptInStart to have the form dialog prompt in start.

willportnoy avatar Oct 07 '16 17:10 willportnoy

@willportnoy

Yes, that makes sense. But if you want a Dialog which asked all already filled fields in my Form i Need To use the Option "PromtFieldsWithValues"?

But with this option the Dialog did mit start.

So Please Tell me how I can start an Dialoge which asks all already filled fields?????

kleeporten avatar Oct 08 '16 12:10 kleeporten

This is indeed a bug. Thanks for bringing this to our attention--sorry it took so long to figure out the issue. The next release should have a fix.

chrimc62 avatar Oct 18 '16 17:10 chrimc62

You're welcome.

Thank you, for the fix. I will test it later.

kevinport avatar Oct 19 '16 03:10 kevinport

@kevinport, I'm closing this issue as fixed, please reopen it if it's not the case. Thanks for reporting the bug!

Andrea-Orimoto avatar Oct 27 '16 21:10 Andrea-Orimoto

I'am so sorry, i was very busy.......

Now our two bots are up to date.... there were some other changes in the framework due to that i have to rebuild my processes which took a bit of time.... (I will open a new issue...)

If i start my Form with these options FormOptions.PromptFieldsWithValues | FormOptions.PromptInStart every thing works fine.

Thank you 👍

kevinport avatar Oct 30 '16 11:10 kevinport