310
Views
7
Comments
Solved
Why we create Local variables?

Hi, this is sateesh,

In this case, I don't want to know the definition. I want to know why and give me one proper example

2023-12-14 09-56-57
Yogesh Javir
Solution

Hey @TELUGU SATEESH ,

  • Local variables are used to store data at screen level. 
  • These stored values will be erase when page refresh  or navigate to other page.
  • These local variables are initiated to its default value at page initialize.
  • You can create local variables to the screens, client actions, server actions etc.,
  •  local variable is directly accessible inside the screen and the corresponding screen elements like client actions, data actions.
  • if the local variable is created inside the client actions inside the screen, that cannot be directly accessible by the screen.

Hope you will understand!

Thanks

Yogesh

2024-12-02 13-16-47
Vipin Yadav
Solution

Hi sateesh,  

I have added oml please check.

Thanks,

Vipin Yadav

FetchingDataExercise.oml
UserImage.jpg
vikas sharma
Champion
Solution

HI Sateesh,

We need local variables to hold some value temporally with in the action/screen/block... Because while writing logic sometime condition raise to store the value for some time so that we can use value later so we store it in local variable. 

As you asked it may be type of entity identifier. Lets say you have some action in that you need to perform few actions for a particular user. So in this case it will be useful if I store UserId in a local variable so can use it anywhere in the scope of that action.

The use of local variable is same in OutSystems as it works in other programming languages. For better understanding you can go through the links mentioned above by other community members.


Regards


UserImage.jpg
TELUGU SATEESH

Hi, Vipin Yadav,

I need one more example for a local variable like a dataType is an entity Identifier.

2024-12-02 13-16-47
Vipin Yadav
Solution

Hi sateesh,  

I have added oml please check.

Thanks,

Vipin Yadav

FetchingDataExercise.oml
UserImage.jpg
Pranav Shingane

Hi,

Local variable have scope within action. In that scope you can use it to store different types of value that outsystem provide.

2023-10-21 19-42-11
Tousif Khan
Champion

Hello,

In his case , You need more explanation , In guided path, we have a video, here it is explained in detail

https://www.outsystems.com/training/lesson/1772/variables-in-outsystems?LearningPathId=2

I hope this helps.

Thanks & Regards

Tousif Khan

UserImage.jpg
vikas sharma
Champion
Solution

HI Sateesh,

We need local variables to hold some value temporally with in the action/screen/block... Because while writing logic sometime condition raise to store the value for some time so that we can use value later so we store it in local variable. 

As you asked it may be type of entity identifier. Lets say you have some action in that you need to perform few actions for a particular user. So in this case it will be useful if I store UserId in a local variable so can use it anywhere in the scope of that action.

The use of local variable is same in OutSystems as it works in other programming languages. For better understanding you can go through the links mentioned above by other community members.


Regards


2023-12-14 09-56-57
Yogesh Javir
Solution

Hey @TELUGU SATEESH ,

  • Local variables are used to store data at screen level. 
  • These stored values will be erase when page refresh  or navigate to other page.
  • These local variables are initiated to its default value at page initialize.
  • You can create local variables to the screens, client actions, server actions etc.,
  •  local variable is directly accessible inside the screen and the corresponding screen elements like client actions, data actions.
  • if the local variable is created inside the client actions inside the screen, that cannot be directly accessible by the screen.

Hope you will understand!

Thanks

Yogesh

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.