To create a questionnaire, we use a simple method — User Input. All components that variables write belong to the conditional invisible group. This is important to remember, because we need to add a visible component before an invisible one to ask a question to a user.
Visible components include Message, Buttons with hints, Buttons for Viber, Dynamic buttons with hints.
For example, let's create a simple questionnaire with 3 questions:
Let's think of variable names:
Add the components to the Screen in the following order: Text, User Input, Text, User Input, Text, User Input. Fill them in with the data in order. Don't forget to save the project.
After creating the questionnaire, we go to the bot, answer the questions and view the variables in User States:
You can also give the user a choice to answer using the Buttons with hints.
These answers will also be written to variables: