Alexa Skill - How to Retrieve Slot Value in Lambda Function

Ingrid picture Ingrid · Jan 16, 2017 · Viewed 10.2k times · Source

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

  1. iqram
  2. ingrid
  3. phil
  4. clyde

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 

Answer

Pseudope picture Pseudope · Jun 6, 2017

var c = this.event.request.intent.slots.slotname.value

This should give you what you're looking for.