Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
What type of variable is intent.slots.myIntent.value in the source code of a lambda AWS JS

I'm doing a skill in the Alexa development console.

An intent within the skill is as follows:

activates the output {mySlot} where mySlot is of type AMAZON.NUMBER

I have taken a lambda function provided by the manufacturer of a microntroller from an example.

This function is a JS file where I have written a function for the aforementioned intent as follows:

function setMyOutPut(intent, session, callback)
{
  ...
  const desiredState = intent.slots.mySlot.value;
  if ((desiredState === 1))
  {
    powerOn = 1;
  }
  else if ((desiredState === 2))
  {
    powerOn = 2;
  }
  else if ((desiredState === 3))
  {
    powerOn = 3;
  }
  else
  {
    speechOutput = "There are only three outputs to activate";
    repromptText = "I did not understand the exit number, please try again';
    callback(sessionAttributes, buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession));
  }
  ...

}

When from Alexa I execute the Skill and the intent, when I say "activates the output one", a confirmation Intent is executed in which Alexa responds "The output has been activated correctly".

But if I say, for example "activate the output seven", in the same way it responds that it has been activated correctly.

Or there are times when I say "activates the output three" and the else is produced and it answers "There are only three outputs to activate".

So what I suspect is that intent.slots.mySlot.value is not a numeric variable.

Any suggestions or comments?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!