botframework-sdk
botframework-sdk copied to clipboard
Select choice from prompt by text input
System Information
- SDK Platform: Node
- SDK Version: 3.8
- Development Environment: localhost
Issue Description
We found that many users don't click on button of Prompts.choice and writes the text of label. When users write with accents don´t work fine.
Example Code
bot.dialog('/', [
function (session) {
let options = {
listStyle : builder.ListStyle['button'],
};
builder.Prompts.choice(session, '¿Qué quieres hacer? Presiona el botón de la opción que necesites.',
[
'Sí',
'No',
'Dónde'
], options);
},
function (session, results) {
session.send('Option selected: '+ results.response.index)
},
]);
Steps to Reproduce
- Run previous code
- Don't click option and write label of button without accent ("si" , "donde").
Expected Behavior
Continue flow with option selected
Actual Results
Don´t recognize option and retry prompt
@carloscba I made a small update to your code it's working fine for me in the emulator.
bot.dialog('spanish_choice_prompt', [
function (session) {
let options = {
listStyle : builder.ListStyle['button'],
};
builder.Prompts.choice(session, '¿Qué quieres hacer? Presiona el botón de la opción que necesites.',
[
'Sí',
'No',
'Dónde'
], options);
},
function (session, results) {
session.send('Option selected: '+ results.response.entity);
session.endDialog();
}
]);
Here you can see it working correctly:

@nwhitmont I am sorry for my mistake on description. The issue occurred when user write with accent.
"si" != "sí"
in this case don't work fine

I found a little solution and close this issue.
Thank for your help @nwhitmont