Ask a question

A Question node prompts a user for information and stores their response in a variable for use later on in the conversation.

The node allows you to choose the type of information to collect, such as a multiple-choice answer, a prebuilt entity, or a custom entity. Question behavior properties allow you to control the behavior of the node, such as what to do when the user enters an invalid response.

Like Message nodes, Question nodes can include images, videos, cards, quick replies, and message variations. For more information, see Send a message.

Tip

Rename nodes to make them easier to identify. Select the node's name field to update the name directly, or select the More icon () of the node and select Rename from the menu. You can also rename nodes in the code editor.

It's not possible to rename Trigger nodes and Go to step nodes.

Node names can be up to 500 characters in length.

Prerequisites

Add a question node

  1. Select the Add node icon below the node under which you want to add a new node, and then select Ask a question. A blank Question node appears.

    Screenshot of a new Question mode with fields to enter a message, set the type of data to collect, and select a variable to store the user response.

  2. In the message box, enter the question you want to ask.

  3. Under Identify, expand the list and select the type of information the agent should identify in the user's response. You can select an existing entity or create a new one if needed. Learn how to use entities in a conversation.

    Depending on the Identify option you selected, there might be more properties to set.

    For example, for Multiple choice options, you must specify the choices the user can select in Options for user. During a conversation, each choice appears as a button, but users can also type their answer.

  4. Select the default variable name under Save response as to open the Variable properties panel and change the name to something meaningful, like customerName or bookingDate.

    To choose a different variable or create a new one, select > to open the Select a variable panel.

  5. To customize the behavior of your Question node, configure question properties.

Configure question properties

The Question properties panel is where you can adjust behaviors like prompting, validation, and interruptions.

  1. To open the Question properties panel, select the More icon () of the Question node, and then select Properties.

  2. In the Question properties panel, select the desired category:

Configure question behavior

Question behavior properties allow you to control whether the copilot can skip the question and how it responds to an invalid response.

Skip behavior

Skip behavior determines what the agent should do if the question node's variable already has a value from earlier in the conversation.

  • Allow question to be skipped: Skip the question if the variable has a value.
  • Ask every time: Ask the question even if the variable has a value.

Reprompt

Reprompt determines how your agent reacts when it doesn't get a valid answer from the user. You can tell it to try again once, twice, or move on without getting an answer. To customize what your agent does when it moves on, configure the properties under No valid entity found in the Entity recognition panel.

  • How many reprompts: The number of times your agent tries to get a valid answer. Repeat up to 2 times is the default. You can also select Repeat once or Don't repeat.
  • Retry prompt: To change the message, select Customize, and then enter the new prompt.

Configure entity recognition

Entity recognition properties allow you to expand validation beyond the default rules for the entity to collect, and to choose what happens when your copilot isn't able to elicit a valid entity value from the user.

Entity settings

Enter the name of the option set you defined in Power Fx used to reference items in the list.

Additional entity validation

By default, the Question node checks for a valid response based only on the entity you selected. Additional entity validation allows you to add criteria to the basic test. For example, the Question node accepts any numeric value when it identifies a number, but you might want to make sure it's less than 10. You can also change the prompt to help the user enter a valid response.

  • Condition: Enter a Power Fx formula that returns a Boolean value (true or false); for example, Topic.Var1 < 10
  • Condition not met prompt: To change the message, select Customize, and then enter the new prompt.

No valid entity found

No valid entity found determines what happens when your agent stops trying to get a valid response from the user. You can escalate to a human agent or provide a default value. You can also change the prompt to give the user more context.

  • Action if no entity found:

    • Escalate: Redirect the user to the Escalate system topic. This is the default behavior.
    • Set variable to value: Set the output variable to a value and move on to the next node. Enter or select the value in Default entity value.
    • Set variable to empty (no value): Clear the output variable and move on to the next node. You can use a Condition node later to check whether the variable has a value.
  • No entity found message: To change the message, select Customize, and then enter the new prompt.

Configure interruption behavior

Interruption settings determine whether the user is allowed to interrupt the flow of the current topic to switch to a different topic.

  • Allow switching to another topic: The user can switch to a new topic when their response to the question matches a trigger for the other topic with high confidence.
  • Only selected topics: Specify to which topics the user can switch from this question node.