Where to make globale function?


i try to make a global function can be launch from any handler.

so I start to know how to store data
but have any issue , it ’ s seems not work if outside handler

after setHandler

and call method from handler fail too


The this context only works inside a handler intent.

And the function would need to be called without this.


just try again without success


@Sylvain_P You need to use await getsapdata().


i dont get what you mean.
but I try without axios ( TypeError: Converting circular structure to JSON ),

and is ok if I follow this


You’re using an async function inside of an async handler function (ON_REQUEST). If you don’t use this.$session.$data.pomme = await getsapdata();, the handler code won’t wait until your axios call is finished.