When building topics in Copilot Studio, capturing user input accurately is essential and free-text responses can lead to inconsistent data. For example, you might have a topic that allows users to submit a support request. The topic may have a question for the user to pick an issue category or set a priority for a support ticket. Choice variables solve this by presenting predefined options, such as Low, Medium, or High priority, which keeps data structured and predictable. However, if you try to use a choice variable directly in an agent flow, you can encounter an error: Input variable is of incorrect type: ClosedListOptionSet.

Screenshot showing a question in Copilot Studio asking for the issue priority, with the 'Issue Priority' variable set as a choice type.

Let’s see why that happens and a fix so you can use choice variables in your flows.

Why the error happens

Choice variables are stored as a special data type in Copilot Studio. When you pass them into an agent flow, the flow expects a text value, not the choice object. If you try to use the choice variable as-is, the flow cannot interpret it, which causes the error.

The Fix: Convert the choice variable to text

To resolve this, you need to convert the choice variable into text when passing it to the flow. This is done using a formula in your topic.

Steps to apply the fix

1. Create your Choice Entity

    In your topic, define the choice options you want users to select from. You might ask a question that uses a custom entity or multiple choice options.

    Let’s say we create a question for users to pick their issue priority. It uses a custom entity with the values:

    • Low
    • Medium
    • High

    Add the Question to your topic. The variable will automatically be stored as the choice type.

    Screenshot of Copilot Studio showing a topic creation interface with a question about issue priority, options for Low, Medium, and High, and an input field for saving the user's response.

    2. Prepare the Agent Flow

    In your agent flow, add an input in the flow’s trigger When an agent calls the flow for the value you want to pass from the topic. This should be a text input. Then, continue building out your flow.

      Screenshot of Copilot Studio interface displaying input prompts for ticket creation, including fields for customer name, email, issue description, issue priority, and issue category.

      3. Convert the choice variable

        Once you build the flow, you need to add it to your topic and link the variables to the flow inputs. In your topic, add the Agent flow node and select your flow.

        For the input that is the choice variable (IssuePriority in this example), click on

        Screenshot of the Customer Care Assistant interface showing the Create Ticket section and Power Automate inputs for customer support, with a highlighted issue priority input.

        Select the Formula tab and enter a formula in the format of: Text(variable name)

        For example: Text(Topic.IssuePriority)

        Replace Topic.IssuePriority with the name of your choice variable. Click Insert.

        Screenshot showing the Copilot Studio interface with the 'Enter formula' dialog open, displaying the formula 'Text(Topic.IssuePriority)' and options for insertion.
        Screenshot showing the Power Automate inputs configuration for creating a ticket, highlighting the IssuePriority field with a formula to convert the choice variable to text.

        To find your variable name, use the suggestions that appear when typing your formula. A Topic scope variable will begin with Topic. and a Global scope variable will begin System.

        Input form for entering a formula in Copilot Studio, highlighting the 'IssuePriority' variable selection.

        Leave a comment