Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Variables in OutSystems

Topics

● Variables
○ Input Parameter
○ Output Parameter
○ Local Variable

● Data Types
○ Structures
○ Lists

2
Variables

Variables are locations in memory that can hold data


● Hold data of a particular data type
● Can be any data type

Variables are defined and exist in a particular scope


● Values can be accessed and modified in that scope
● If execution leaves that scope, the variable is destroyed

Variables can be:


● Input Parameters
● Output Parameters
● Local Variables

3
Input Parameter

Passes a value into its parent’s scope


from the outside scope

Can be set as Mandatory


● Requires that the parameter must
have a value assigned it

The variable is destroyed when


execution leaves the scope of the
parent element

4
Output Parameter

Returns a value from inside its


parent’s scope to the outside scope

A value must be assigned to the


Output Parameter inside its scope

The variable continues to exist in


the outside scope even after its
parent element’s scope is gone

5
Local Variable

Exists exclusively within the scope of


its parent element

Can be assigned and used “locally”


inside that scope

The variable is destroyed when


execution leaves the scope of the
parent element

6
OutSystems Data Types

OutSystems language is Strongly Typed


● Every variable must declare its data type
● That data type can not change

OutSystems supports:
● Basic Types
○ Integer, Text, Date, ...
● Compound Types
○ Entities
○ Static Entities
○ Structures
● Lists

7
Structures

Structures are custom compound data types

Used to store compound data in memory


● A Structure is the definition of a data type
● The Structure itself does not hold any value
○ Structures are not variables
● The Structure’s data type is a collection of other simple
and compound data types that are grouped together

Structures are defined by attributes of any data type


● Including other Structures, Entities and Lists

8
Creating Structures

Add Structure and set its Properties


● Set its Name
● Can be public

Add Structure Attributes


● Set their Names and Data Types
● Can be mandatory
● Can have a default value

9
Lists

A List is a collection of elements of the


same data type (e.g. List of Integers)

Elements of OutSystems Lists can be:


● Basic types (e.g. Integer)
● Compound types (e.g. Entities or Structure)
● A union record between different types
○ e.g. Integer + Text
○ e.g. Booking + GuestName

Type of List can be defined in the Data Type Editor

10
Summary

● Variables
○ Input Parameter
○ Output Parameter
○ Local Variable

● Data Types
○ Structures
○ Lists

11
OutSystems Variables
Thank You!

You might also like