What is the difference between client variable and simple variable?

I just want to know the basic difference between client variable and local variable.

If client variable is good enough then why we need to use local variable. Can anyone suggest me.

Hi, 

Client variables are Persistent, and are kept client side, between sessions. They can even be shared between applications of the same environment and browser. 

They also have a broader scope, so they are visible on any place inside the module. 

This means that you shouldn't use it indiscriminately, as you will lose one of the important aspects of programing, that is isolation. 

Só, if you need this capabilities, use a Client variable. Otherwise, use local variables. 

Cheers 

Hi Priyanka,


Client variables just stores basic data types and are used in the reactive and mobile context:

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Data/Handling_Data/Client_Variable


You can see in this link in detail what is the client variables context and verify the differences.


Hope this can help you.


Best regards,

Ricardo M Pereira

Hi Priyanka,

You can read more about what Client Variables can be used for. They persist on the client-side, even if you change screens.

Local Variables only exist within the context of the screen/action/block they were defined in.

Hope this helps

Solution

Hi Priyanka,

The main difference is you can access the client variable anywhere in the application. like global variable inside the module.

Also you can change the value of it and can access from anywhere in the module.

But for Local variable has the scope in which it is defined. This is only for temporary purpose in the action flow.

Local variable can release the memory when it left the scope. (this is the advantage)

Regards,
Manish K


Solution

Manish Kumawat wrote:

Hi Priyanka,

The main difference is you can access the client variable anywhere in the application. like global variable inside the module.

Also you can change the value of it and can access from anywhere in the module.

But for Local variable has the scope in which it is defined. This is only for temporary purpose in the action flow.

Local variable can release the memory when it left the scope. (this is the advantage)

Regards,
Manish K


Thanks Manish.