question

Anzak avatar image
Anzak asked

resolved slot value as an array name

if (slotValues.listableThings.ERstatus === 'ER_SUCCESS_MATCH') {

switch (slotValues.listableThings.resolved){

case 'CLASSES': {

lookupArray = sessionAttributes.classes;

};

break;

default:

break;

}


Is there a way to do this instead of using a switch to just set lookupArray = sessionAttributes.(slotValues.listableThings.resolved)


Everything I can find on java script says alert but alert is not defined in skills so not sure how this would work. In this instance it is pretty limited to just one item but when I start expanding it the list could get very long and I do not want to have to update 4 or even 5 switch statements everytime I add an item.

alexa skills kit
10 |5000

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

0 Answers