Global Variables

Global Variables

  

1. How do I create and set values for Global Variables in OutSystems P10 (Mobile app).

What go you mean with global variables? Session? Site? Local?

I mean Session Variables.


On a mobile device you don't have a session. 


You can make a local database (or web) and store the value into it or pass it through in each screen/action.


Kind regards,

Evert



This seems like a work around with bad practice. It means I would have to make request to the database each time I need the variable. 

That's not a work around, thats mobile (-:


Local storage is quick enough I think.....

You can attempt to create a global javascript variable by creating a javascript that sets this.variablename, then another function to retrieve it.  However, I would caution you because I'm not sure about that type of variable being persistent when the app closes and reopens.  You would need some rigorous testing for your use case.

I would also advise you to use local storage.