Set global property

Hi everybody!
I need to store a global property to be used by different pages. I've already tried with the setProperty method, but the property seems to be page-scoped.
There's a method to access to this property from all the pages? maybe using localstorage?

Thanks in advance.

Indeed page properties are "local" to the page. They map to class properties of the Angular component. You can use localStorage and sessionStorage to implement global properties. To set such a property use Execute Code action:

You can get the value via sessionStorage.getItem("key"). Just keep in mind that all values stored in session and local storage a strings.

4 Likes

It works!
Thanks a lot!