Available Data Types
This page describes the data types available in OutSystems, their default values and constraints, and the built-in functions to convert them into another data type.
Basic Data Types
Type | Default Value | Example | Comment |
---|---|---|---|
Binary Data | Byte array with no elements | n/a | |
Boolean | false | true or false | |
Currency | 0.0 | 545870.025 | See Decimal type. |
Date | #1900-01-01# | #1988-08-28# | The supported range is [#1900-01-01#, #3000-12-31#] |
Time | #00:00:00# | #12:20:56# | Minimum value: #00:00:00# Maximum value: #23:59:59# |
Date Time | #1900-01-01 00:00:00# | #1988-08-28 23:59:59# | The supported range is [#1900-01-01 00:00:00#, #3000-12-31 23:59:59#] Refer to the additional notes about the time zone conversions. |
Integer | 0 | 2147483600 | Minimum value: -2^31, which is -2147483648. Maximum value: 2^31-1, which is 2147483647. |
Long Integer | 0 | 5645245584135987412 | Minimum value: -2^63 Maximum value: 2^63-1 |
Decimal | 0.0 | -158121.025 4000.0 | Integer and decimal parts must be separated by a period. Minimum value: -2^96 Maximum value: 2^96-1 The maximum number of digits in the decimal part is 8. |
"" (empty string) | "fran.wilson@company.com" | ||
Phone Number | "" (empty string) | "+1 555 565 3730" | |
Text | "" (empty string) | "My name is Christina Sharp." | |
<Entity> Identifier | When an Entity is created, the <Entity> identifier data type is created for the identifier attribute. |
Date Time Notes
-
When you work with Date Time data type in the server, you always deal with the time zone of the server.
-
Date Time in mobile apps is always UTC, even when requested from the server.
-
When you use Date Time in the mobile app UI, the value is converted to the local time of the device.
Here is an example for a server that is in GMT+01 (Paris) and a mobile device in GMT-05 (New York). The mobile device requests a certain Date Time value from the server, for example #2007-12-18 17:00:00#
. What happens is:
-
The value is converted by the server to UTC
#2007-12-18 16:00:00#
and sent to the mobile device. -
When you store the value in the mobile app, the value is handled as UTC and saved as
#2007-12-18 16:00:00#
. -
When you display the value in the UI, the end-users see
#2007-12-18 11:00:00#
.
If you do not need this scenario in your logic, use data types Date and Time separately to deal with the respective values.
Compound Data Types
Type | Comments |
---|---|
<Entity> or <Structure> | When an Entity or Structure is created, a data type is also created with all the attributes of that Entity or Structure. For example, when the Customer entity is created, the Customer data type is created. To create a variable of this data type, simply set its 'Data Type' property to 'Customer'. To access an attribute of the variable, use the following syntax: <variable>.<attribute> , e.g. MyCustomerVar.Name |
Object | OutSystems supports the Object data type to allow you to reuse your own Java or .NET classes. The default value is NullObject(). |
Record | A Record is a data type that's composed of a fixed number of attributes, each one with its own data type. Use a Record to define a compound data type that is used for a single variable. If you need to define more than one variable with the same compound data type, use a Structure instead. Some use cases for using the Record data type are:
|
Collection Data Types
Type | Comments |
---|---|
List | A List is a sequence of elements of the same data type, either basic or compound. Elements can be inserted, fetched, and removed from a list. Learn more about the List data type . |
Default and Null Values
OutSystems does not use the concept of the NULL value, except for the Entity Identifier data type. Therefore, each data type has an associated default value that is assigned at creation.
Data Type Conversions
OutSystems enables the conversion between different data types. This can be made implicitly, or explicitly by using data type conversion functions.
Implicit Conversion
OutSystems automatically converts values of the following types:
Expected Type | Accepted Types | Obs. |
---|---|---|
Boolean | - | |
Currency | Decimal, Integer, Boolean, Entity Identifier(Integer) | |
Date | Date Time | |
Date Time | Date, Text, Time | |
Integer | Decimal, Boolean, Currency, Entity Identifier(Integer) | When converting Decimal to Integer implicitly, the decimals are truncated. |
Long Integer | Long Integer, Integer, Decimal, Boolean, Currency, Entity Identifier(Integer), Entity Identifier(Long Integer) | |
Decimal | Integer, Boolean, Currency, Entity Identifier(Integer) | |
Entity Identifier | Entity Identifier | A certain Entity Identifier can be converted into another Entity's Identifier, but a warning is displayed. |
Text, Phone Number, Integer, Decimal, Boolean, Currency, Entity Identifier(Integer), Entity Identifier(Text), Date Time, Date, Time | ||
Phone Number | Text, Email, Integer, Decimal, Boolean, Currency, Entity Identifier(Integer), Entity Identifier(Text), Date Time, Date, Time | |
Text | Integer, Decimal, Boolean, Currency, Phone Number, Email, Entity Identifier(Integer), Entity Identifier(Text) |
Explicit Conversion Functions
To convert values from one data type to another use data type conversion functions .
Here is a summary about the possible explicit conversions:
From | To | Function |
---|---|---|
Boolean | Integer Text |
BooleanToInteger BooleanToText |
Date | Date Time Text |
DateToDateTime DateToText |
Date Time | Date Text Time |
DateTimeToDate DateTimeToText DateTimeToTime |
Integer | Boolean Decimal Text Integer Identifier |
IntegerToBoolean IntegerToDecimal IntegerToText IntegerToIdentifier |
Long Integer | Long Integer Identifier Integer Text |
LongIntegerToIdentifier LongIntegerToInteger LongIntegerToText |
Decimal | Boolean Integer Text |
DecimalToBoolean DecimalToInteger DecimalToText |
Entity Identifier (Integer) | Integer | IdentifierToInteger |
Entity Identifier (Long Integer) | Long Integer | IdentifierToLongInteger |
Entity Identifier (Text) | Text | IdentifierToText |
Text | Date Date Time Decimal Integer Time Text Identifier |
TextToDate TextToDateTime TextToDecimal TextToInteger TextToTime TextToIdentifier |
Time | Text | TimeToText |
Any data type | Object | ToObject |