I am developing an Alexa Skill with one Intent that includes a Slot with several possible values.
My slot is defined with "name" : "Channel"
, "type" : "LIST_OF_CHANNELS"
, and values
How do I retrieve the uttered slot value to use in my Lambda function? It's the "retrieve value of slot from utterance part" I'm looking to have answered. Thanks so much.
// retrieve value of slot from utterance
var c = intent.slots.Channel.value;
// append value to end of URL that references API
fetchEnseParse("/channel/" + c, function(body) {
// continuation of this function is below
To configure the slot for multiple valuesOn the Skills tab, in the SKILL NAME column, click the name of your custom skill. From the left-hand sidebar, click Custom > Interaction Model > Intents. Click an intent to open the detail page for the intent. In the list of Intent Slots, find the slot to change.
Phrases. Phrase slot types allow for input from a user with fewer constraints on format and content. Make sure that your skill uses no more than one phrase slot per intent. The following phrase slot type is supported. Slot Type.
The Alexa Skills Kit provides the APIs, tools, and documentation to create these new skills, powered by your own services running as Lambda functions. Amazon Echo users can access these new skills by asking Alexa questions or making requests. The Alexa Skills Kit is available on GitHub.
var c = this.event.request.intent.slots.slotname.value
This should give you what you're looking for.
In the event that your lambda receives you can find it here...
{
"request": {
"type": "IntentRequest",
"intent": {
"name": "YourIntentName",
"slots": {
"slotname": {
"name": "slotname",
"value": "HERE!"
}
}
},
"locale": "en-US"
},
}
The event is passed to your lambda handler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With