I'm updating my question. I have requirement to subscribe the multiple items from list. I was searching on internet for the same but no luck and no option to select multiple option by using choice prompt with botframework nodejs SDK.
I guess if we use the prompt.text() its allow to accept the response entity as string may be it will help me to achieve my goal and also needed the button look and feel for the optionList.
Here is my Code
bot.dialog('/Subscriptions List', [
function (session, args) {
getSubscriptionsdemo(session);
},
function (session, results) {
session.send(results.response);
if(results.response.entity != '') {
session.send("You entered '%s'", results.response);
session.beginDialog('/Confrim Subscribe');
}
}
]);
function getSubscriptionsdemo(session) {
var body = [{"Name":"Computers"},{"Name":"Technology"},{"Name":"photography"},{"Name":"Cars"},{"Name":"Sports"}];
var jsondata = (body);
//var jsondata = parseJson(subscribeData);
var subscribeArray = '';
var indexVal =1;
for (var i = 0; i < jsondata.length; i++) {
if (jsondata[i].Name != '' && jsondata[i].Name != undefined && jsondata[i].Name != null) {
subscribeArray += indexVal+'. '+jsondata[i].Name+'\n';
}
indexVal++;
}
if(jsondata.length > 0) {
builder.Prompts.text(session, "Select your subscriptions [ Multiple selectation seperate by comma (,) ]?\n\n"+subscribeArray);
} else {
session.send('There is no subscriptions have been associated. You can use the back or top command.');
session.beginDialog('/menu');
}
}
OR
Can we apply the listStyle to Prompts.text() in bot framework.
builder.Prompts.text(session, 'Cat|dog|mouse',{listStyle: builder.ListStyle.list});
Please guide me if Yes.
thanks