Learn how to guide conversation flows using FormFlow within the Bot the static MakeRootDialog method, which in turn, calls the FormDialog. To convert files on your computer to the Portable Document Format file format, you need to have a PDF print driver installed. When Adobe Acrobat, or other open. Issues starts when we start using the FormFlow di. there a way to render the adapative card by converting the hero card in the client?.. in my.
|Published (Last):||18 September 2009|
|PDF File Size:||16.52 Mb|
|ePub File Size:||5.46 Mb|
|Price:||Free* [*Free Regsitration Required]|
Advanced features of FormFlow – Bot Service | Microsoft Docs
This topic applies to SDK v3 release. You can find the documentation for the latest version of the SDK v4 here. Basic features of FormFlow describes a basic FormFlow implementation that delivers a fairly generic user experience.
Converg deliver a more customized user experience using FormFlow, you can specify initial form state, add business logic to manage interdependencies between fields and process user input, and use attributes to customize prompts, override templates, designate optional fields, match user input, and validate user input. When you launch a FormDialogyou may optionally pass in an instance of your state. If you do pass in an instance of your state, then by default, FormFlow will skip steps for any fields that already contain values; the user will not be prompted for those fields.
To force the form to prompt the user for all fields including those fields that already contain values in the initial statepass in FormOptions. If a field contains an initial value, the prompt will use that value as the default value.
You can also pass in LUIS entities to bind to the state. Type is a path to a field in your C class, convery EntityRecommendation. Entity will be passed through the recognizer to bind to your field. FormFlow formfloww skip steps for any fields that are bound to an entity; the user will not be prompted for those fields. To handle interdependencies between form fields or apply specific logic during the process of getting or setting a field value, you can specify business logic within a validation function.
A validation function lets you manipulate the state and return a ValidateResult object that can contain:. This code example shows a validation function for the Toppings field. If input for the field contains the ToppingOptions.
Everything enumeration value, the function ensures that the Toppings field value contains the full list of toppings. In addition to the validation function, you can add the Term attribute to match user expressions such as “everything” or “not”.
Using the validation function shown above, this snippet shows the interaction between bot and user when the user requests “everything but Jalapenos. Default prompts are automatically generated for each field in your form, but you can specify a custom prompt for any field by using the Prompt attribute.
For example, if the default prompt for the SandwichOrder. Sandwich field is “Please select a sandwich”, you can add the Prompt attribute to specify a custom prompt for that field. This example uses pattern language to dynamically populate the prompt with form data at runtime: By default, the description of a field is generated from the field’s name. To specify a custom description for a field, add the Describe attribute.
Basic features of FormFlow
A Prompt attribute may also specify parameters that affect how the form displays the prompt. For example, the ChoiceFormat parameter determines how the form renders the list of choices. In this example, the value of the ChoiceFormat parameter indicates that the choices should be displayed as a bulleted list instead of a numbered list. While the Prompt attribute enables you to customize the prompt for a single field, the Template attribute enables you formfow replace the default templates that FormFlow uses to automatically generate prompts.
This code example uses the Template attribute tl redefine how the form handles all enumeration fields. The attribute indicates that the user may select only one item, sets the prompt text by using pattern languageand specifies that the form should display only one item per line. This snippet shows the resulting prompts for the Bread field and Cheese field. If you use the Rormflow attribute to replace the default templates that FormFlow uses to generate prompts, you may want to interject some variation into the prompts and forjflow that the form generates.
To do so, you can define multiple text strings using pattern languageand the form will randomly choose from the available options each time it needs to display a prompt or message.
This code example redefines the TemplateUsage. NotUnderstood template to specify two different variations of message. When the bot needs to communicate that it does not understand a user’s input, it will determine message contents by randomly selecting one of the two text strings.
To designate a field as optional, use the Optional attribute.
This code example specifies that the Cheese field is optional. If a field is optional and no value has been specified, the current choice will be displayed as “No Preference”.
If a field is optional and the user has specified a value, “No Preference” will be displayed as the last choice in the list. When a user sends a message to a bot that is built using FormFlow, the bot attempts to identify the meaning of the user’s input by matching the input to a list of terms.
By default, the list of terms is generated by applying these steps to the field or value:. To override this default behavior and define the list of terms that are used to match user input to a field or a value conveft a field, use the Terms attribute.
For example, you may use the Terms attribute with a regular expression to account for the fact that users are likely to misspell the word “rotisserie.
By using the Terms attribute, you increase the likelihood of being able to match user input with one of the valid choices. MaxPhrase parameter in this example causes the Language. GenerateTerms to generate additional variations of terms. This snippet shows the resulting interaction between bot and user when the user misspells “Rotisserie. To restrict the range of allowed values for a numeric field, use the Numeric attribute.
This code example uses the Numeric attribute to specify that input for the Rating field must be a number between 1 and 5. To specify the required format for the value of a particular field, use the Pattern attribute. This code example uses the Pattern attribute to specify the required format for the value of the PhoneNumber field. This article has described how to deliver a customized user experience with FormFlow by specifying initial form state, adding business logic to manage interdependencies between fields and process user input, and using attributes to customize prompts, override templates, designate optional fields, match user input, and validate user input.
For information about additional ways to customize the user experience with FormFlow, see Customize a form using FormBuilder. Our new feedback system is built on GitHub Issues. Read about this change in our blog post. Note By default, the description of a field is generated from the field’s name.
Would you like to provide feedback? Sign in to give feedback. You may also leave feedback directly on GitHub. There are no open issues.