Learn
Control Dialog in Lambda
Confirmation Status: Intent

In addition to slots, confirmationStatus can be used with intents. Intent confirmation is useful for confirming actions of high consequence. These actions

  • are publicly visible (like social media),
  • affect another person (like sending a message),
  • or involve money.

After collecting all of the slot values for the Video Match skill (genre, videoType, and optionally decade), the intent confirmation would sound like:

ALEXA: So you're looking for an action movie from the 90's, right?

Access the intent confirmation status in the JSON request with:

this.event.request.intent.confirmationStatus

Like the confirmationStatus for slots, this confirmationStatus for intents can take any one of these values:

  • If the user responds affirmatively, confirmationStatus for that slot will be 'CONFIRMED'
  • If the user responds negatively, it will be 'DENIED'
  • If the user hasn’t confirmed or denied the intent yet, it will be 'NONE'

Instructions

1.

We’ve provided one of the JSON requests from this part of a conversation:

ALEXA: So you're looking for an action movie from the 90's, Right? USER: Yup.

You can view the request on the right and you can access it with JavaScript in main.js.

Because this is a reserved word in JavaScript, we’ve setup main.js so you can omit this, and start with event.

Use console.log to print the intent confirmationStatus.

2.

We can use this property in conditionals as well. Write an if-else if-else statement that checks the value of confirmationStatus:

  • If the status is 'NONE', print 'Intent not confirmed yet!'
  • Else if the status is 'DENIED', print 'Intent denied!'
  • Else print 'Intent confirmed!'

Folder Icon

Take this course for free

Already have an account?