Step 4: Add the selection placeholder chip

So far, we've created a variable to store the user's rate inquiry selection, a passage that prompts the user with three options, and then stores their selection as a value. Now let's use that variable in our chatbot content to confirm the user's selection.

Variables can be used almost anywhere in your chatbot content by adding variable placeholder chips. To add a variable, type the @ key and choose the variable you want to use. When the user reaches this passage, the chatbot replaces the placeholder chip with the value stored during the conversation.

Let's confirm our user's selection:

  1. Open the Property valuations passage created by the buttons.
  2. Rename the passage to Confirm rate inquiry option.
  3. In the text message, type a message to the user to confirm their choice.
    To use the Rate Inquiry variable, type @ and choose the RateInquiry variable.
  4. Click Save.

Now the chatbot asks the user what kind of rate inquiry they're interested in, saves their response to the RateInquiry variable, and uses that value in the next passage to confirm their selection without needing duplicate passages.

When writing content with variables, remember that the variable value will be the default value (or blank, if you haven't set a default) until a value is saved by an action during the conversation. In this guide, there are no questions or other passages leading to our confirmation passage, so we know the variable will always have a value.

It's good practice to check whether a user can reach your passage without the variable being set. If they can, then either add a default value to your variable, or write your chatbot content so that it it will still seem natural if the variable is blank.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.