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

How to Add an Input Parameter

    1. Right-click the element (web screen, web block, ...) in the eSpace tree, and select Add Input Parameter;

    2. Define its properties. Learn more about the input parameter properties.

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:

When are Input Parameters Passed as Reference or Value

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

Input Parameters Passed as Value

Most OutSystems 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.

An example of an input parameter passed as value could be the case of the GetUserProfile function, that receives the Integer parameter UserId as input parameter, and changes its value. As a consequence, the changes made to the UserId inside this function doesn't change its value outside.

Input Parameters Passed as Reference

However, to avoid performance deterioration, when the action called is from the same module 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.

An example could be the function AddUserToList, that receives a List with the users and the UserId to add to the list. After inserting the UserId the change be reflected in the action that is executing the AddUserToList action.

How to Delete an Input Parameter

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

Input Parameter Properties

Property

Description

Optionality

Default value

Obs.

Name

Name of the Parameter.

Mandatory

 

See rules for naming elements.

Description

Free text that describes the action or process parameter. You can edit the text by directly typing it in the property or in the description editor which opens by clicking

Optional

 

Useful for documentation purposes.

The maximum size of this property is 2000 characters.

Data Type

List of all the data types supported by the OutSystems Platform. In this list you'll also find the Identifiers of all the entities of the module.

Mandatory

Text

See list of possible data types.

Record Definition

List of entities and structures created in the module. You can type the name of the entity or structure, use the Record Editor or select one of the entities and structures displayed.

Optional

 

This property value has to be set only if the property Data Type is a Record or a Record List.

Is Mandatory

Boolean value that indicates whether the parameter is optional or mandatory.

Mandatory

Yes

This property is not available for Web Services parameters.

Advanced Properties

The following properties are only visible for input parameters of consumed REST API and Web Services.

REST API Properties

Properties for an input parameter of consumed REST APIs.

Property

Description

Optionality

Default value

Obs.

Original Name

The name of the input parameter.

N/A

 

Read-only.

Send In

Indicates where the input parameter value is placed in the request:

  • URL: the input parameter and its value are sent in the URL;
  • Header: the input parameter and its value are sent in the header of the request;
  • Body: the input parameter and its value are sent in the body of the request.

Learn more About REST API Method Parameters

Mandatory

 

 

Default Value

Value for the input parameter if it has no value set. See the available options.

Optional

 

The default value can be a literal or one of the following built-in functions:

NullDate(), NullIdentifier(), NullObject(), NullTextIdentifier(), CurrDate(), CurrTime(), CurrDateTime() or NewLine().

Send Default Value

Indicates the value that is sent in the request payload when the attribute is holding its default value.

N/A

 

 

Available Options for the 'Send Default Value' Property

If the input is:

The available options are:

Mandatory and Not Null

Yes: the default value is sent.

Mandatory and Null Allowed

Yes: the default value is sent.

No: the null value is sent instead of the default value.

Optional and Not Null

Yes: the default value is sent.

No: no value is sent.

Optional and Null Allowed

Yes: the default value is sent.

No: no value is sent.

SOAP Properties

Properties for an input parameter of consumed SOAP Web Services.

Property

Description

Optionality

Default value

Obs.

Original Name

The name of the input parameter.

N/A

 

Read-only.

Default Value

Value for the input parameter if it has no value set.

Optional

 

The default value can be a literal or one of the following built-in functions:

NullDate(), NullIdentifier(), NullObject(), NullTextIdentifier(), CurrDate(), CurrTime(), CurrDateTime() or NewLine().

Send Default Value

Indicates the value that is sent in the request payload when the attribute is holding its default value. See the available options.

N/A

 

 

Original Description

The description of the input parameter.

N/A

 

Read-only.

Original Default Value

The default value of the input parameter.

N/A

 

Read-only.

Min. Occurrences

The input parameter is optional if this property has 0 (zero) value.

N/A

 

Read-only.

Max. Occurrences

Indicates the number of values that can be sent in the input parameter. When set with unbounded there is no limit.

N/A

 

Read-only.

Nillable

Indicates whether the input parameter allows nil values.

N/A

 

Read-only.

Available Options for the 'Send Default Value' Property

When the WSDL definition of the attribute is:

The available options are:

Mandatory and Not Null

(Min.Occurences=1 and Nillable='No')

Yes: the default value is sent.

 

See an example

Mandatory and Null Allowed

(Min.Occurences=1 and Nillable='Yes')

Yes: the default value is sent.

No: the 'nil' value is sent instead of the default value.

 

See an example

Optional and Not Null

(Min.Occurences=0 and Nillable='No')

Yes: the default value is sent.

No: no value is sent.

 

See an example

Optional and Null Allowed

(Min.Occurences=0 and Nillable='Yes')

Yes: the default value is sent.

No: no value is sent.

Send 'nil': the 'nil' value is sent instead of the default value.

 

See an example

See Also

About Variables | About Output Parameters | Use User Functions