База знань GetMyBot

Scenarios

Build a questionnaire in chat: ask questions in order and save a customer's answers.

На цій сторінці

A scenario asks questions in order and remembers the answers. For an inquiry, the bot might ask for a name, phone number, and suitable time. The answers are saved in the customer's profile so you can use them in a confirmation or pass them to a manager. Configure it under Scenarios. In the API, a scenario is called a flow.

What is a scenario

A scenario consists of steps. In each step, enter a question and a parameter, the name of the profile field where the answer will be saved. For example, save the answer to "What is your name?" under name. After the scenario finishes, the bot can insert it into a message with {{param.name}} or check it in another reaction's condition.

Creating a scenario

  1. Open Scenarios → Add.
  2. Enter a Name, such as "Consultation request".
  3. Add questions and choose a parameter to store each answer.
  4. Put the steps in the order you want.

For example, a three-question form could look like this:

StepQuestion to the customerSave the answer under
1What is your name?name
2What is your phone number?phone
3When is a good time for you?preferred_time

Launching from a reaction

Add the Run scenario action (start_flow) to a reaction and select the scenario you created. A /order command or a button press can trigger it. Go through the questions in chat and check the saved parameters in the customer's profile. You can then use them in other actions and reactions.

Scenario or dialog steps?

Dialog steps in the message builder can also ask for and validate an answer. They are configured inside one reaction and support formats such as phone number, email, and choices. A scenario can be reused in several reactions; dialog steps belong to one message. See Messages and buttons.

What's next