524
Views
9
Comments
Solved
What are the differences between the Input parameter, Output parameter, and local var
Question

What are the differences between the Input parameter, Output parameter, and local variable, and exactly in which cases can use these parameters?

I'm confused where to use these parameters and I'm new to this platform.



Thank you.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Swathi,

Not only new to OutSystems, but also new to programming I assume? Does any of the above answers help you? If so, you could mark one or more as solution. If not, could you explain a bit more what you don't understand about the concepts?

In programming, not just OutSystems, actions (or, as they're sometimes called in other programming languages, functions or procedures) are pieces of code. Quite often, you want that code to do something to some data. It is often the case you want to supply that data to the Action. Say you have an Action that performs a calculation, say it takes the mean of two numbers. You need to supply those two numbers, and then the action must return the result. The two numbers then are input parameters. The result (the mean) is an output parameter. Such an action would then look like this:

You can then call the action with Number1 and Number2 filled in. The result will be returned in Mean, and can be used in your application:

As for local variables (like the "MyDecimal" in the above example), they are used to store temporary data. There's no hard-and-fast rule for when to use them. Variables are a very primary concept in programming, whenever you want to store something you create a variable.

UserImage.jpg
Devendra Baghel

HI Subhash,

This is very basic. Below are the details

Input Parameter is used to send the Input Data to the server action , client Action , REST API, web block etc to perform the task

Out Put Parameter is the result of the task perform by server action , client Action ,REST API ,web block etc

Local Variable is used to hold some value while performing any task in server action , client Action , REST API ,web block etc

Hope this will help you.

Best Regards

Devendra 

2024-06-24 06-15-15
Shraddha Durgade

Hi @Subhash T 

Input variables :- It allow you to pass a value from outside scope to the parent's scope. 

All inputs parameters get destroyed when the execution leaves the scope of parent elements.


Output Variables  :-  It will return a value from inside the parent scope to the outside scope. 

It will continue to exist in the outside scope.

It does not destroyed.

Screen doesn't have output parameter 


Local Variables  :- Exist exclusively within the scope of their parent elements. 

It destroyed when the execution leaves the parent scope.

I Hope this will help you.

Regards,

Shradha Durgade.

UserImage.jpg
Manorama Malviya

Hi

When I have started learning I was getting same problem as yours.

Best Suggestion just do it practically and check scope.

Like screen take local variable and try to access it from other screen.

Try to pass value from input and take from output.


2025-04-16 10-58-33
Priyanka Babar

Hi Subhash

input variable: If you want to take inputs/ data from another screen you have to use this.

Output variable: Screen output if you want to send to another screen you have to use this.

local variable: Remains within the screen



UserImage.jpg
Md Mansur

Hi @Swathi T 


used that oml: for your better understanding


Thanks

Mansur

input&Output&Local.oap
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Swathi,

Not only new to OutSystems, but also new to programming I assume? Does any of the above answers help you? If so, you could mark one or more as solution. If not, could you explain a bit more what you don't understand about the concepts?

In programming, not just OutSystems, actions (or, as they're sometimes called in other programming languages, functions or procedures) are pieces of code. Quite often, you want that code to do something to some data. It is often the case you want to supply that data to the Action. Say you have an Action that performs a calculation, say it takes the mean of two numbers. You need to supply those two numbers, and then the action must return the result. The two numbers then are input parameters. The result (the mean) is an output parameter. Such an action would then look like this:

You can then call the action with Number1 and Number2 filled in. The result will be returned in Mean, and can be used in your application:

As for local variables (like the "MyDecimal" in the above example), they are used to store temporary data. There's no hard-and-fast rule for when to use them. Variables are a very primary concept in programming, whenever you want to store something you create a variable.

2024-02-08 05-52-50
Himanshu dwivedi

Hi Swathi T

The data type of the output parameter. Indicates if the output parameter is also used as an input parameter of the process activity's extended action. – "No": The output parameter is not an input parameter of the Start<Activity>/Close<Activity> extended action.
 Local Variables:- Exist exclusively within the scope of their parent elements. It dis estroyed when the execution leaves the parent scope.

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