- 17 Aug 2023
- 2 Minutes to read
- Print
- DarkLight
About Data Types
- Updated on 17 Aug 2023
- 2 Minutes to read
- Print
- DarkLight
Overview
A Data Type is a classification of data that instructs the platform how to handle the data and how it may be utilized.
Every variable has a Data Type. By default, Decisions defines a set of built-in Alphanumeric Types and Composite Types that represent a wide variety of logical constructs.
The Data Type may be simple, such as Int32 (a 32-bit integer value) or Boolean (True or False value), or it may be a Composite Type such as a User Account or Database Structure. Simple Types have only one value, whereas Composite Types are structures that may have many values.
When working with data in the Flow Designer, always consider the Data Type. For example, a String (text) Data Type would not work for a math function for this function expects an integer value.
The following information that may be stored in a Data Type:
- The storage space that a variable of the type requires.
- The maximum and minimum values that it can represent.
- The members (methods, fields, events, and so on) that it contains.
- The base type it inherits from.
- The location where the memory for variables will be allocated at run time.
- The kinds of operations that are permitted.
Most Common Data Types in Decisions
For math calculations, use Integral and Floating-Point Types as follows:
Integral Types
Type | Range | Size |
---|---|---|
SByte | -128 to 127 | Signed 8-bit integer |
Byte | 0 to 255 | Unsigned 8-bit integer |
Char | U+0000 to U+ffff | Unicode 16-bit character |
Int16 | -32,768 to 32,767 | Signed 16-bit integer |
Int32 | -2,147,483,648 to 2,147,483,647 | Signed 32-bit integer |
Int64 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | Signed 64-bit integer |
UInt64 | 0 to 18,446,744,073,709,551,615 | Unsigned 64-bit integer |
Floating Point Types
Type | Approximate Range | Precision |
---|---|---|
Single | ±1.5e−45 to ±3.4e38 | 7 digits |
Double | ±5.0e−324 to ±1.7e308 | 15-16 digits |
Decimal | (-7.9 x 1028to 7.9 x 1028) / (100 to 28) | 28-29 digits |
Single and Double are Floating Binary Point Types to represent a number like this: 10001.10010110011. The binary number and the location of the binary point are both encoded within the value. Floating Binary Point Types are much faster to work with than decimals.
For values that are either imprecise or immense (such as with artifacts of nature or that which cannot be precisely measured), Float/Double Data Types are more appropriate. Scientific data is often represented in this form.
Decimal is a floating decimal point type to represent a number like this: 12345.65789. The number and the location of the decimal point are both encoded within the value – which keeps the Decimal as a Floating-Point Type instead of a Fixed-Point Type. For non-repeating decimal fractions and whole numbers, the most common Data Type is Decimal. This is usually suitable for any concepts invented by humans, such as financial values or product ratings.
With these Data Types, the original values are not "decimally accurate" to start with, so it is not important for the expected results to maintain decimal accuracy.
Non-Integral Type
datatype | Purpose |
---|---|
String | Represents alphanumeric text as a series of Unicode characters. String Type is used for all text data manipulations. |
TimeSpan | Represents a time interval. |
DateTime | Represents an instant in time, typically expressed as a date and time of day. |
Boolean | Represents a Boolean (true or false) value. Used in logical evaluations like ‘Yes’ or ‘No’. |
FileData | Represents File in Decisions. Contains following members: Content (Byte Array), FileName (String), FileType (String), Length (Int32), Tag (Object). |
Data Type Naming Rules
Data Types cannot have non-Latin characters and most special characters. Their names cannot begin with digits. Their names cannot be null.
The chart below shows which special characters can and cannot be used.
Character | Useable? |
---|---|
! | No |
@ | No |
# | No |
$ | No |
% | No |
^ | No |
& | No |
* | No |
( | No |
) | No |
- | Yes |
_ | Yes |
+ | No |
= | No |
{ | No |
} | No |
[ | No |
] | No |
, | No |
. | No |
< | No |
> | No |
? | No |
/ | No |
\ | No |
| | No |