Acces to data fetch in other intent

amazon-alexa

#1

Hi
I have session called sapEvent fetch api content in launch
, and i will use in all other Intent, like YesIntent, but it return undefined

app.setHandler({

  async LAUNCH() {
    const todayFormat = getCurrentDateFormat();
    const response = await fetchUrlData(todayFormat);
    this.$session.$data.sapEvent = response.data;
    let speech = "bienvenue sur SAP, voulez sortir ? " + response.data.data[0].title;
    let reprompt = 'nom d une sortie ou une categorie.';
    this.ask(speech, reprompt);
  },
  YesIntent() {
    console.log(this.$session.$data.sapEvent)
    let speech = this.$session.$data.sapEvent.description;
    this.tell(speech);
  },

console.log(this.$session.$data.sapEvent)
return undefined or empty.

So how to acces to sessions in all intent ?


#2

solved by using this.$data


closed #3