I created bot using QnaMaker.ai service and Microsoft azure services.It's working fine with webchat channel.Now i integrated it with Microsoft Team channel and that's where i got into a problem.
The prompts that were working in webchat channel are not working same in Teams channel.
Like for question i showed 4 options to select.But in microsoft teams they are Bot in webchat channel
and bot in Teams

- 111
- 13
2 Answers
Are you trying to show Suggested Actions? Suggested actions are not supported in Microsoft Teams. if you want buttons to appear on a Teams bot message, please try using cards.

- 6,405
- 6
- 28
- 69

- 2,076
- 1
- 5
- 9
-
Yes im trying to show suggested action(multi turn conversation) – parthraj panchal Oct 01 '19 at 04:51
-
i attatched screenshots that what i want and what i got – parthraj panchal Oct 01 '19 at 05:06
-
As mentioned above, Suggested actions are not supported in Microsoft Teams. You need to use cards to display the buttons. – Gousia Begum Oct 01 '19 at 05:08
-
i implemented this and is working too good! Thanks for the solution. – parthraj panchal Oct 03 '19 at 08:28
You can use ChoiceFactory.toChoices in Teams and it will work. I prefer this method because it's simple (all you need is the array of choices as strings) and it works, but you can also use ChoiceFactory.forChannel which should automatically format the choices for ANY channel. Here is an example from one of the bots I use in Teams, where the buttons display fine. This is nodejs but the same class will work in C#.
FOCUS_AREAS = ['Chatbots','RPA','Blockchain','AR/VR','AI & ML'];
return await step.prompt(FOCUS_AREA_PROMPT, {
prompt: 'Which focus area is this for?',
choices: ChoiceFactory.toChoices(FOCUS_AREAS)
});
Reference from Microsoft: https://learn.microsoft.com/en-us/javascript/api/botbuilder-dialogs/choicefactory?view=botbuilder-ts-latest
Examples: Here is the output from the code above. The total length is too long to render as buttons in Teams channel, so it has automatically switched to a numbered list.
The below uses the same exact ChoiceFactory.toChoices implementation, just with fewer options so it renders as buttons instead of a numbered list.

- 2,705
- 2
- 9
- 32
-
I added screenshots to the answer. As noted, the buttons will automatically change to numbered list at a certain total length, all is being done with standard prompt and ChoiceFactory.toChoices to create the options. – billoverton Oct 03 '19 at 14:38
-
so this can be used only when i have fewer options right? @billoverton – parthraj panchal Oct 04 '19 at 03:48
-
1It has to do with the total length, not the number of options. But yes, if you have too many options it will render as a numbered list. I don't believe there is a way to force buttons once you exceed that length as the channel won't support it. – billoverton Oct 04 '19 at 13:03