This product version has reached end of life and is no longer supported. Click here for the latest documentation.

Input parameters allow you to send data so that it becomes available for processing in the scope of an element (action, screen, ...).

Examples

The GetUserProfile action uses an input parameter to allow specifying which user profile it is going to fetch.

The Video_Show screen displays a video. To identify which video to play, an input parameter is used.

An input parameter is used to change the behavior of the web block. The screen using the web block can specify is the user submitted comments are displayed expanded or collapsed.

Elements Having Input Parameters

Input parameters can be used in the following elements:

Adding and Removing Input Parameters

To add an input parameter to an element, do as follows:

To delete a parameter, right-click it in the eSpace tree and select the option Delete .

How Input Parameters are Used

Once you create input parameters, you need to specify the values that are send through them (also known as the arguments of the action). For example, if a screen action has the ProductId input parameter, the button that triggers it, needs to specify the value of the argument.

The following elements can specify an input parameter value:

Handling Input Parameters in Actions and Web Blocks

When using input parameters in Actions and Web Blocks, it is important to understand how they are handled by the OutSystems Platform: by value or by reference.

Most Service Studio data types are passed by value , i.e. a new memory location is created for each input parameter with the value being copied from the argument. Any later change made to it inside the scope of, for example, the action does not affect the value of the argument in the caller scope.

In the example below, if the GetUserProfile internally changes the value of the UserId input parameter, it is only changing its own copy. No changes are made to the UserId of the action that is executing the GetUserProfile action.

However, to avoid performance deterioration, there are data types that are passed by reference:

For these data types, no copy is created, meaning that changes done inside the scope, are reflected in the caller scope. In the example below, the action receives a Record List through an input parameter, and modifies the list to include a new user. This change will also be reflected in the action that is executing the AddUserToList action.

What You Should Know

Due to the OutSystems Platform architecture, when referencing Actions or Web Blocks from other eSpaces, input parameters are sent by value, regardless of their data type.

This means that in the previous example, if the AddUserToList is an action referenced from other eSpace, it internally creates a copy of the UserList and appends a new User to that list. However, this change is not reflected outside the scope of the AddUserToList action, since only the copy of the UserList is changed.

See Also

Input Parameter Properties | Data Types of Input Parameters | About Variables | About Output Parameters | Use User Functions