question

furkandogan avatar image
furkandogan asked ·

User's Responses

i want to compare user response with alexa's request how i can use user's response in my code

alexa skills kithow-tovoice-user interface
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jamie Grossman avatar image
Jamie Grossman answered ·

It depends on how you're writing your skill, but you can get the user response in your code like so:

var myName = this.event.request.intent.slots.firstname.value;

We have a quick start tutorial here that talks about the whole process; give it a shot. Then when you're in your code and you have the value, you could do something like:

if (userValue == 'Hello')
{
    //do this
}
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.