To add a new template a developer simply needs to:
-
Create and add the new template json file in
<project>/plugins/templateSelector/templatesdirectory -
Add a reference to the template location and corresponding field that will be used to identify the template in the
<project>/plugins/templateSelector/templateConfig.json -
Make any necessary updates to code for the template selection logic in the
plugins/templateSelectorplugin (there may be none) -
If applicable, make any necessary updates to code for the
plugins/preProcessorand/orplugins/postProcessorlogic
A great resource is the adaptive card designer which can be found here. This helps to prototype and adjust the various settings/styles and options for adaptive cards before creating the template code for them. The Schema Explorer and Samples pages are also excellent resources to help with designing new adaptive card templates.
To address the need to reduce the number of items returned and rendered in a drop down can be addressed by creating an additional adaptive card template in the flow that uses an Input.Text field type and allows the user to search on a keyword. Based on this input text field, you can add functionality to the bot to handle these search terms sent into the messaging extension MessagingExtensionQuery. In this way you can pre-filter and only provide relevant options for the user to choose between.
