Now that we've asked the user for their name, let's assign their response as the value of variable.
Values are assigned to variables using actions. Actions can be attached to almost any interaction your user has with your chatbot, including pressing buttons or Quick Replies, sending information, or entering passages, conversations, or entry points.
We'll add an action to the Send Info expected response so the chatbot assigns the user's response to our Username variable.
In the Request user name passage you created:
- Scroll down below the passage selector for the Send Info response.
- Click Actions.
- Click + Action.
- Select Save value to variable.
- Leave with what users send selected.
- In the dropdown, select the Username variable.
- Click Save to close the Actions configuration.
- Click Save to save the passage.
When the user sends their name in response to the passage, the chatbot stores what they send in the Username variable before it moves on to the next passage.
The Send Info response created a new passage to send the conversation to. Let's configure that passage to use the variable to address our user by name.
Comments
Article is closed for comments.