Echo & Alexa Forums
General Category => Alexa Software Development & Technical Discussion => Topic started by: Mechdude on October 28, 2015, 05:16:20 am
-
Does anyone know if this is possible?
I have an intent like {
{
"intents":
[
{
{
"intent": "Values",
"slots":
[
{
"name": "Value1",
"type": "LITERAL"
},
{
"name": "Value2",
"type": "LITERAL"
}
]
},....
in my code I have the following:
var value1 = intent.slots[0];
var value2 = intent.slots[1];
however when I try to run this both values are undefined. I also tried
var value1 = intent.slots.Value1;
var value2 = intent.slots.Value2;
But got the same result, they were both undefined. Does anyone know if this is indeed possible? and if so how would I get the values in code?
Thanks for your time
-
Seems I had a mismatch in the JSON as I was sending an Array of slots, and this was not expected on the lambda. Removing the [] fixed it for me
-
I have not seen much documentation on the data structure of intents.
But it would seem that you cannot nest them. That is, no multi-dimensional arrays.