Dialog: PromptDialog

10 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€46.42
List Price:  €64.99
You save:  €18.57
£39.83
List Price:  £55.77
You save:  £15.93
CA$68.34
List Price:  CA$95.68
You save:  CA$27.34
A$75.68
List Price:  A$105.96
You save:  A$30.28
S$67.48
List Price:  S$94.48
You save:  S$27
HK$390.53
List Price:  HK$546.78
You save:  HK$156.24
CHF 45.23
List Price:  CHF 63.33
You save:  CHF 18.09
NOK kr543.62
List Price:  NOK kr761.11
You save:  NOK kr217.49
DKK kr346.42
List Price:  DKK kr485.02
You save:  DKK kr138.59
NZ$83.17
List Price:  NZ$116.44
You save:  NZ$33.27
د.إ183.60
List Price:  د.إ257.06
You save:  د.إ73.45
৳5,471.12
List Price:  ৳7,660.01
You save:  ৳2,188.88
₹4,168.17
List Price:  ₹5,835.78
You save:  ₹1,667.60
RM236.95
List Price:  RM331.75
You save:  RM94.80
₦61,737.65
List Price:  ₦86,437.65
You save:  ₦24,700
₨13,922.21
List Price:  ₨19,492.21
You save:  ₨5,570
฿1,837.56
List Price:  ฿2,572.74
You save:  ฿735.17
₺1,617.36
List Price:  ₺2,264.43
You save:  ₺647.07
B$253.57
List Price:  B$355.02
You save:  B$101.45
R925.26
List Price:  R1,295.44
You save:  R370.18
Лв90.75
List Price:  Лв127.05
You save:  Лв36.30
₩67,788.68
List Price:  ₩94,909.58
You save:  ₩27,120.90
₪185.81
List Price:  ₪260.15
You save:  ₪74.34
₱2,852.60
List Price:  ₱3,993.87
You save:  ₱1,141.27
¥7,651.71
List Price:  ¥10,713.01
You save:  ¥3,061.30
MX$848.33
List Price:  MX$1,187.73
You save:  MX$339.40
QR182.01
List Price:  QR254.83
You save:  QR72.82
P679.12
List Price:  P950.82
You save:  P271.70
KSh6,605.16
List Price:  KSh9,247.76
You save:  KSh2,642.59
E£2,394.23
List Price:  E£3,352.12
You save:  E£957.88
ብር2,861.57
List Price:  ብር4,006.43
You save:  ብር1,144.85
Kz41,791.64
List Price:  Kz58,511.64
You save:  Kz16,720
CLP$47,104.79
List Price:  CLP$65,950.47
You save:  CLP$18,845.68
CN¥361.79
List Price:  CN¥506.53
You save:  CN¥144.74
RD$2,896.80
List Price:  RD$4,055.76
You save:  RD$1,158.95
DA6,728.30
List Price:  DA9,420.16
You save:  DA2,691.86
FJ$112.64
List Price:  FJ$157.70
You save:  FJ$45.06
Q387.49
List Price:  Q542.52
You save:  Q155.02
GY$10,429.06
List Price:  GY$14,601.52
You save:  GY$4,172.46
ISK kr6,980.60
List Price:  ISK kr9,773.40
You save:  ISK kr2,792.80
DH502.81
List Price:  DH703.98
You save:  DH201.16
L883.05
List Price:  L1,236.34
You save:  L353.29
ден2,855.74
List Price:  ден3,998.26
You save:  ден1,142.52
MOP$401.24
List Price:  MOP$561.77
You save:  MOP$160.53
N$922.79
List Price:  N$1,291.99
You save:  N$369.19
C$1,835.15
List Price:  C$2,569.36
You save:  C$734.20
रु6,656.11
List Price:  रु9,319.09
You save:  रु2,662.97
S/186.09
List Price:  S/260.54
You save:  S/74.45
K192.70
List Price:  K269.79
You save:  K77.09
SAR187.48
List Price:  SAR262.50
You save:  SAR75.01
ZK1,344.69
List Price:  ZK1,882.68
You save:  ZK537.98
L230.99
List Price:  L323.40
You save:  L92.41
Kč1,163.34
List Price:  Kč1,628.77
You save:  Kč465.43
Ft18,094.88
List Price:  Ft25,334.28
You save:  Ft7,239.40
SEK kr539.27
List Price:  SEK kr755.02
You save:  SEK kr215.75
ARS$43,903.33
List Price:  ARS$61,468.17
You save:  ARS$17,564.84
Bs345.22
List Price:  Bs483.33
You save:  Bs138.11
COP$194,164.52
List Price:  COP$271,845.87
You save:  COP$77,681.34
₡25,478.72
List Price:  ₡35,672.25
You save:  ₡10,193.53
L1,231.47
List Price:  L1,724.16
You save:  L492.69
₲373,200.63
List Price:  ₲522,510.75
You save:  ₲149,310.11
$U1,910.59
List Price:  $U2,674.97
You save:  $U764.38
zł200.97
List Price:  zł281.37
You save:  zł80.40
Already have an account? Log In

Transcript

Hello guys, welcome to the eighth session of using Microsoft Word freema, Lewis and cognitive services tutorials for beginners. In this session we will create chrome dialogues in both. Till now we have just displayed a message to the user. We have retrieved text messages from the activity. In this session, we will retrieve the value from the user by using Chrome dialogue. There are pro dialogues available for you to use to manage conversation flow, and each of them will render differently on separate channels.

Dialogues that allow the users to model conversation and manage conversation flow. The probe is used whenever a boat needs input from the user. You can use pro to ask the user for a series of inputs by chaining the prompts. Now, suppose those from dialogs By using text dialog, we will return text from the user. Using confirm dialog, we asked the user for confirmation. Using numbers, we can retry the numeric value from the user.

In choice, we can provide a list of options from the user can select any option. Using attachment, we can obtain image or video from a user. In this session, I will show text and have a normal dialogue to the user. Here is an example that we are going to create. Let us switch to Visual Studio, create a new class file under dialogue folder name from them and also add those four namespaces. Here I will extend it from a dialog.

Let us implement its method. Here I'm going to create two Private variables that contain me and age. First of all, we need to return thanks message in starting for that, right awake context dot post a sink and pass a message. Let's create a new method name, get name a sink and take idi low context and I have a table of iMessage activity. In this method, we will just show text from dialog for obtaining the name from the user. For that, right chrome dialog dot txt, which takes several parameters.

Let us add context and pass the context. Next, sec resume in which we need to pass method that will perform the operation. Let us take resume that name and in Ground Zero value that will be displayed to the user. That is display. Please enter your name in the trial set value that will be displayed if the user enters wrong tags are not matching the criteria I am writing here. Sorry, I didn't understand that.

Please try again. Because of this method didn't task we need to write written task not completed task. Let us create a handler for that. I'm copying this method and pasting it and changing the name to resume that name. And change the second parameter to the type of I have a table of string. First of all set the value that we have got to the property.

After retrieving the name, we will return age four for that we need to use prone dialogue of number type and in resume change to resume get age and change message to please enter your age. In the prefix I'm going to add a name. So the user can feel more interactive and remote written statement. After displaying transfer age, we need to process it copyable method and paste it change method name to resume that is and here we will get I have a table of law assign result of age. Now we will prompt for confirmation. So change number to confirm changes resume to resume confirm and change chrome message to your name escapes and your ages this right again copy this method change the name to resume confirm.

Change second parameter type two is available of boon remove all existing code if awake result here if user presses And then we got through, otherwise we got false. Here. If it is true, then we need to display value name and age to the user for that right away and text dot poster sync and write an entire message. Otherwise, we need to return Yep, I held out. And if we got false then we need to pass it to the previous dialog for that right context dot dot method, and pass the string dot empty or this. Here we have created three prompts for name, ease and confirmation.

Now we need to call it from status in methods. For that right context dot wait method and pass get name a sync and open message controller in send a sync file neutron lemme see all the files and run it open emulator let us say hi, here we got a welcome message from both and type Neela we got nilay Please enter your age that is take 20 and we got confirm dialog that is select yes it shows all it is that way right. Let us start a new conversation right name and age. This time I'm going to send No, we have switched to old dialog that is thanks message. Now I'm going to add some more properties and features in our example this retry message will be prone many user enters invalid values for example string in number. In that situation retry message will be displayed and again try to obtain value.

However, there is a limit of retry attempts, we can specify number of retry attempts using attempts parameter. In case of number we can also specify minimum and maximum value that can hold. For example, if you want to allow the only person with age 18 to 50, then you can write this in confirm dialog, we can also set values for the option. For example, instead of displaying yes and no, you want to display yes and no. We can also change from style how options will be displayed. Let us change it to per line.

Both framework also supports markdown syntax. If you're not familiar than markdown, allow to set both Heading, underline, strikethrough, image hyperlink etc and attaching a link for reference that contains all these shapes. Here in case of confirmation, I'm going to display the value in Italy. For this we need to write text between single aesthetic. And in case of the last message, I'm going to display text in bold. For that, use double asterisks.

Save the file and run it. Open emulator. Start a new conversation. Send Hi, right Neela in me. And in here, we got text. Sorry, I didn't understand that.

Please try again. That we have stored in return parameters. Now I'm going to send 60 and again, same 60 One more time. Now we got an exception of maximum number of attempts to start a new conversation. Send me a 20 year both value in Italy we got yes and no in the text. Here we got a success message and both values in bold.

Let's see what we have learned in this session. prompt is used to obtain values from the user. There are five types of groups. As of now we have created this example. To display text, we need to use Chrome dialogue dot text method and set context presume chrome parameters. Along with those we can also set retry message and maximum number of attempts.

To display number Chrome, we need to use number method we can set minimum and maximum values for the. To create confirm from, we need to use confirm method. We can additionally set labels for options, and it's time for channels. In this example, I have used for line but I suggest you to use auto. We can also use markdown syntax in messages. We will use form flow for multiple choice instead of choice.

We will see in next session. Thanks for watching this video. If you have any doubts, please feel free to contact me. Have a nice day.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.