Simple types
Last updated
Was this helpful?
Last updated
Was this helpful?
The type of a variable delineates the set of values it can hold. In this document, you will learn about the different simple types a Flow variable can have.
The number type can hold hold numeric values, including both integers and floating-point. Number values are written in decimal representation, using the point character to separate the integer and fractional parts.
The text type, known as "string" or "varchar" in other languages, can hold variable-length sequences of Unicode characters. Literal text values can be written using either single or double quote characters.
A text literal that begins with a double quote may contain single quote characters. The converse is also true.
A literal surrounded by the backquote (`) character is known as a template literal. In a template literal, expressions can be inserted within curly braces.
Template literals, unlike single and double quoted literals, may also contain line breaks.
The boolean type represents a truth value. A variable of type boolean can only be assigned the values true or false.
A value with the primitive type may be either number, text, boolean, datetime, binary or null. Type checking is relaxed for such values: you can freely use a value of type primitive in any situation where a number, text, boolean, etc. is called for. However, the actual value must be compatible with the requested type, or the application will fail at runtime.
Some characters such as line feeds and backspaces must be inserted into the literal by means of an escape sequence. An escape sequence is formed by a backslash character followed by one or many escape sequence characters. For example, if you want to specify a text literal representing several lines of text, the escape sequence \n can be used to insert a line feed character: "first line\nsecond line"
. Similarly, the double quote character can be inserted into a double quote-delineated text literal by means of the \" escape sequence. For a full list of supported escape sequences, refer to the .
Boolean values are often used in conjunction with .
The datetime type represents a calendar date and time of day. Unlike numbers, texts and booleans, datetime values have no special literal syntax. Instead, you typically receive them from a Date input, or work with them programmatically using the function, the function or any of the functions in the .
The binary type represents unintepreted variable-length binary data such as an image, an encoded block of text or a PDF document. Binary variables typically orignate from a File gallery or the . There is no literal syntax for binary values.