Display a multi-select options list in Copilot Studio

Note

This article applies to classic chatbots only. To extend copilots created in Copilot Studio, you don't need to use Bot Framework Composer. All features described in this article are available for copilots, directly in Copilot Studio.

Enhance your bot by developing custom dialogs with Bot Framework Composer and then adding them to your Microsoft Copilot Studio bot.

In this example, you'll learn how to display a multi-select list in Microsoft Copilot Studio by using Composer.

Important

Composer integration isn't available to users who only have the Teams Microsoft Copilot Studio license. You must have a trial or full Microsoft Copilot Studio license.

Prerequisites

Create a new dialog

  1. In Copilot Studio, open the bot you created in Example 1. If you haven't completed Example 1 yet, see Show an Adaptive Card in Copilot Studio.

  2. Open your bot in Composer. For instructions on how to do so, see Get started with Bot Framework Composer.

  3. In Composer, go to the Create page. In your bot, select More options (...) then select + Add a dialog. For Name enter DailySpecials.

  4. In your new DailySpecials dialog, select the BeginDialog trigger to open the authoring canvas.

  5. On the authoring canvas, select Add (+), Manage properties, and Set a property.

  6. In the properties pane:

    1. For Property, enter conversation.days_array.

    2. For Value, change the type to [] array.

      Screenshot of how to change the type of the value property.

    3. For Value, copy and paste the following array

      ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
      

Screenshot of the completed dialog.

Configure bot responses

  1. Go to the Bot Responses page, select DailySpecials, then select Show code.

  2. Copy and paste the following template into the code view to create daily offers for all the days of the week.

    # DailySpecials(day)
    - SWITCH: ${day}
    - CASE: ${0}
        - All tofu meals are 10% off on Sundays!
        - Every Sunday, all tofu entrees are 10% off.
    - CASE: ${1}
        - All steak options are 10% off on Mondays!
        - Enjoy your Monday with a special offer of 10% off on all steak dishes!
    - CASE: ${2}
        - All the chicken meal options are 10% off on Tuesdays!
        - Tuesday special is 10% off on all the chicken dishes!
    - CASE: ${3}
        - All the chicken and tofu meal options are 10% off on Wednesdays!
        - Wednesday special is 10% off on all the chicken and tofu dishes!
    - CASE: ${4}
        - On Thursdays, get a free delivery in Seattle, Bellevue, and Redmond on all orders over $80!
        - Thursday special is a free delivery on orders over $80 in Seattle, Bellevue, and Redmond.
    - CASE: ${5} 
        - Friday special - get a 10% discount on all dishes and delivery is free on all orders over $80!
        - Every Friday, we offer 10% off on all meals and a free delivery on orders over $80!
    - CASE: ${6}
        - On Saturdays, we have a free delivery on all orders over $50.
        - Free delivery on all orders over $50 on Saturdays!
    - DEFAULT:
        - Holiday special - free delivery anywhere in Seattle, Bellevue and Redmond on orders over $70 today!
        - Holiday Delivery is on us if you are in Seattle, Bellevue and Redmond and your order is over $70 total!
    

    Screenshot of daily offers logic entered into the code view.

Prompt for user input

  1. Go to the Create page. In the bot explorer, under DailySpecials, select BeginDialog.

  2. On the authoring canvas, select Add (+), Ask a question, and Multi-choice.

  3. Select the User Input (Choice) action. In the properties pane, under Responses, enter Please select a day:

    Screenshot of the bot response set.

  4. Select the User Input page in the properties pane, then do the following:

    1. For Property, enter conversation.day_choice.

    2. For Output format, choose index to return the index of the selected option instead of a value.

      Screenshot of user input set.

    3. For List style, choose heroCard to display our options list vertically.

    4. For Array of choices, change the type to Write an expression.

      Screenshot of changing the type of the array of choices property.

    5. For Array of choices, enter =conversation.days_array.

      Screenshot of the expression entered into the array of choices property.

Display daily special

  1. On the authoring canvas, select Add (+) then Send a response.

  2. In the properties pane, under Bot responses, and select Show code. Copy and paste the following expression:

    - ${DailySpecials(conversation.day_choice)}
    

    Screenshot of the daily specials response set.

  3. In the bot explorer, go to the main dialog. Select More options (...) then select Add new trigger.

    Screenshot of the add a new trigger menu item.

  4. In the Create a trigger window, do the following:

    1. For What is the type of this trigger?, select Intent recognized.

    2. For What is the name of this trigger?, enter Specials.

    3. For Trigger phrases, copy and paste the following:

      -what specials do you have
      -any special deals
      -do you have discounts
      

      Screenshot of trigger phrases added to a new trigger.

    4. Select Submit.

  5. In the bot explorer, select the Specials trigger.

  6. On the authoring canvas, select Add (+), Dialog management, then Begin a new dialog or topic.

  7. In the properties pane, for Dialog name, select DailySpecials

    Screenshot of the begin a new dialog action.

Test your bot

  1. Publish your Composer content to make it available in your Microsoft Copilot Studio bot.

    Important

    Selecting Publish in Composer makes the changes available for testing, but doesn't automatically publish your bot.

    Publish your bot in Microsoft Copilot Studio to update your bot across all the channels it's connected to.

  2. Go to the Microsoft Copilot Studio Topics page to see your new Specials and DailySpecials topics.

    Screenshot of the topics added in Composer in the list of topics on Microsoft Copilot Studio.

  3. Open the Test bot pane and make sure Track between topics is turned on. Enter the message Do you have any specials? to start your conversation.

    Screenshot of the Microsoft Copilot Studio test bot pane.

Next step

Use Bing Search as a fallback in Copilot Studio.