Articles → MICROSOFT BOT FRAMEWORK → Describe attribute in FormFlow

Describe attribute in FormFlow






Purpose




Picture showing the Microsoft documentation of describe attribute in form flow in microsoft bot framework

Click to Enlarge


Fields in Describe attribute















Example




[Describe(Description = "the name (written on your PAN card)")]
public string name;




Picture showing the default message when describe attribute is not used

Click to Enlarge

Picture showing the overridden message when describe attribute is used

Click to Enlarge



public enum MaritalStatus { [Describe(Message = "Thank you for selecting the option Married")]
	Married,
	Unmarried,
	Single
}

[Describe(
Description = "Marital Status", Image = "http://gyansangrah.com/ArticleImages/introduction_to_photoshop_three.JPG", Title = "Need for documentation purpose", SubTitle = "Please select between Married/Unmarried/Single")]
public MaritalStatus ? maritalStatus;


Picture showing the marital status card without image, title, subtitle and message

Click to Enlarge

Picture showing the marital status card with image, title, subtitle and message

Click to Enlarge



Picture showing the output when the user clicks on the married option in marital status card

Click to Enlarge


Complete Code


using Microsoft.Bot.Builder.FormFlow;
using System;

namespace Bot_Application1.Dialogs {
	public enum MaritalStatus { [Describe(Message = "Thank you for selecting the option Married")]
		Married,
		Unmarried,
		Single
	}

	[Serializable]
	public class FormFlowDemo { [Describe(Description = "the name (written on your PAN card)")]
		public string name;

		[Describe(Description = "Marital Status", Image = "http://gyansangrah.com/ArticleImages/introduction_to_photoshop_three.JPG", Title = "Need for documentation purpose", SubTitle = "Please select between Married/Unmarried/Single")]
		public MaritalStatus ? maritalStatus;

		public static IForm < FormFlowDemo > GetForm() {
			return new FormBuilder < FormFlowDemo > ().Message("Welcome to support chat system. Please enter the following information to serve you better").Build();
		}
	}
}



Prompt attribute






[Prompt("What is your marital status")]
public MaritalStatus ? maritalStatus;




Picture showing the output of the prompt attribute in microsoft bot framework

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, October 13, 2020

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250