Help with help intent

amazon-alexa

#1

I am developing for Alexa. The user must fill in these slots: city of origin, city of destination and date. I would like to invoke Help Intent to identify which of these slots the user stopped at, issue a help message, and then return to the Intent that was filling the slots at the point where it left off. I can not do that. Can anyone help?

    SearchIntent() {
      const validation = this.validate(schema)

      if (!this.$alexaSkill.hasSlotValue('fromCity')) {
        //code omitted
        return
      }

      if (validation.failed('fromCity')) {
        //code omitted
        return
      }

      if (!this.$alexaSkill.hasSlotValue('toCity')) {
        //code omitted
        return
      }

      if (validation.failed('toCity')) {
        //code omitted
        return
      }

      if (!this.$alexaSkill.hasSlotValue('date')) {
        //code omitted
        return
      }

      return this.toIntent('ResultIntent')
    },
    HelpIntent() {
      let helpMessage
      if (!this.$alexaSkill.hasSlotValue('fromCity')) {
        helpMessage = 'required fromCity' //How to say this message?
        return this.toIntent('SearchIntent') //and come back to this point in this Intent ?
      }

      if (!this.$alexaSkill.hasSlotValue('toCity')) {
        helpMessage = 'required toCity' //How to say this message?
        return this.toIntent('SearchIntent') //and come back to this point in this Intent ?
      }

      if (!this.$alexaSkill.hasSlotValue('date')) {
        helpMessage = 'required toCity' //How to say this message?
        return this.toIntent('SearcSearchIntenthDeparturesIntent') //and come back to this point in this Intent ?
      }

      return this.toIntent('SearchIntent')
    }

#2

Hi @hitsugaya,

I think the following would be a better approach. Please note that this does not include storing the input data, which you’d have to do either in session or user data.

SearchIntent() {
    const validation = this.validate(schema);
    if (validation.failed('fromCity')) {
        const speech = 'The slot value fromCity has an unexpected value. Can you try saying that again?';
        const reprompt = 'I didn\' get that, could you try saying that again?';
        return this.ask(speech, reprompt);
    }

    if (validation.failed('toCity')) {
        const speech = 'The slot value toCity has an unexpected value. Can you try saying that again?';
        const reprompt = 'I didn\' get that, could you try saying that again?';
        return this.ask(speech, reprompt);
    }

    if (validation.failed('date')) {
        const speech = 'The slot value date has an unexpected value. Can you try saying that again?';
        const reprompt = 'I didn\' get that, could you try saying that again?';
        return this.ask(speech, reprompt);
    }

    this.toIntent('ResultIntent')
}

ResultIntent() {
    
}



#3

I had done something similar. But, I need to call Alexa HelpIntent “help” to identify which slot padding it left off and return to this point in SearchIntent