I am developing an Alexa Skill using nodeJS 10 and lambda function.
My skill has the following behaviour:
- I say a number and the skill's intent makes an Api call with this number, in order to get a json with some data.
- I build a speechoutput with a static phrase and with a value with is retrieve from the json.
what is the problem? I get the speechoutput before the Api call makes effect, i.e., I get a error because "cannot read a property of undefined".
is there some workaround in order to get the api response before the speechoutput woulb be sended?
It looks like the code is not able to process the api call code synchronously.
thanks in advance,