For slots of high consequence — money, dates, values with multiple meanings, hard-to-hear words — we need to confirm the user-provided value. Making a mistake with these types of values could be costly or just annoying to users.
How does the Lambda function know when to confirm a slot? It must check the confirmation status of the desired slot(s). The function can then direct the conversation based on that information.
Here’s an example slot confirmation:
ALEXA: What genre would you like? USER: Horror! ALEXA: Horror movies are rated R. Do you still want that genre? USER: Yes.
At every turn of the conversation, the confirmation status for each slot is included in the JSON request sent to your skill. It can be accessed with:
When Alexa confirms a slot value, as in the example above, we expect the user to give a yes or no answer.
- If the user responds affirmatively,
confirmationStatusfor that slot will be
- If the user responds negatively, it will be
- If the user hasn’t confirmed or denied the slot yet, it will be
We’ve provided one of the JSON requests from this part of a conversation:
ALEXA: I heard action. Is that correct? USER: Yup.
console.log to print the confirmationStatus for
We can use this property in conditionals as well. Write an
else statement that checks the value of
- If the status is NOT
'Slot not confirmed yet!'
- Else print