Data Types
Lambda processes work with a defined set of data types that are important to understand to model process logic correctly. Below, you will find a brief definition and best practices on each data type.
Texts represent character strings such as names, addresses, descriptions, etc. When using text strings, consider the following best practices:
Use them for data that will not be numerically processed.
Validate the length or format when required (e.g., using regular expressions).
Use the convert to text block to transform numeric values into text.
To retrieve the value of a register that contains text, use the register text block. The #S expression should not be used.
Numbers represent numeric values, both integers and decimals. When using numbers, consider the following best practices:
Tip
Lambda processes use decimal notation for numerical manipulation. The register number block accepts both decimal and Veritran (VT) notation, and VT values are automatically converted into decimal.
To convert from decimal to VT notation, use the parse number to VT notation block.
Be mindful of rounding and formatting, especially when the value is displayed to the user.
If the number represents a non-quantitative entity (e.g., postal code), consider treating it as text.
To retrieve the value of a register that contains a number, use the register number block. The #S expression should not be used.
Dates represent datetime values. When using dates, consider the following best practices:
Determine the timezone used in the app. For such purpose, use the TARGET_TIME_ZONE parameter.
If no timezone is specified, the device timezone will be applied.
You must specifically define time zones in web apps to avoid interpretation differences between heavy and light lambda processes.
Maintain consistency in time zones used in operations.
Use the date type for data that require temporary operations or validations, instead of handling them as text or numbers.
When comparing or calculating dates, ensure that all dates have the same format and time zone applied.
Use the register text block to obtain the token value and then use the convert [text] to [date] transformation block to convert the date with the corresponding format.
Booleans represent a true or false value. They can be set directly to true or false, or be the result of a logical expression (e.g., comparison, validation). They are commonly used in conditional structures (if, else if, etc.). When using booleans, consider the following best practices:
Use names that clearly express a condition (e.g., isActive, hasDiscount).
Avoid using the negative (e.g., notActive).
Lists represent an ordered collection of elements of the same type. When using lists, consider the following best practices:
Ensure consistency in the data type of the elements included in the list. Avoid mixing types (e.g., number and text) in the same list.
JSON objects represent a data structure composed of key-value pairs. They can be nested, this means that values may themselves be objects or lists. The JSON objects section provides more details on best practices to apply when creating or parsing JSON objects.
Important
JSON is currently the only supported object type in lambda processes.