Capture user response

User speaks card is used to capture user response to a question. There are two ways to capture the user reply, capture as text or capture as variable. In the example below, user can reply yes or no.

User – Alexa, open guess the music director

Alexa – Welcome to music director quiz game ! Shall we start the game ?

Capture as text

It is right time to introduce utterances, utteances are possible replies to the question. In the above example, user can possibly utter yes, yeah, yup, etc. So If the user answers any of these utterance, Alexa considers it the correct answer and bot replies accordingly.

The highlighted blue box in the image is collection of utterances to a questions. To add more utterance to the user speaks card, press ( + utterance ) button. Please ensure the save button is clicked everytime when there is new addition to the card.

Capture as variable

To carry over the user response to other code blocks or cards, user reply can be captured in a variable. To capture as variable, put variable name inside { } eg : {variable_name}. Variable name should not have space and case sensitive.

Alexa – Here is your song, music plays for 10 seconds, who is the music director ?

User – AR Rahman

In the above example, user response will be any directors name based on the music played. Variables are slots in Alexa app. We can define multiple possible answers to a variable (slot) by adding custom slot values. For the {musicdirector} variable, the possible slot values can be AR Rahman, Harris Jayaraj, Iman, etc.