Stay organized with collectionsSave and categorize content based on your preferences.
A literal represents a constant value of a built-in data type. Some, but not all, data types can be expressed as literals.
String literals
String literals must bequoted, either with single (') or double (") quotation marks.
Quoted literals:
Literal
Sample usage
Notes
Quoted string
"abc"
"it's"
'it\'s'
'Title: "Boy"'
Quoted strings enclosed by single (') quotes can contain unescaped double (") quotes, as well as the inverse.
Backslashes (\) introduce escape sequences. See the Escape Sequences table below.
Quoted strings cannot contain newlines, even when preceded by a backslash (\).
Raw string
R"abc+"
r'f\(abc,(.\*),def\)'
Quoted literals that have the raw string literal prefix (rorR) are interpreted as raw/regex strings.
Backslash characters (\) do not act as escape characters. If a backslash followed by another character occurs inside the string literal, both characters are preserved.
A raw string cannot end with an odd number of backslashes.
Raw strings are useful for constructing regular expressions.
Escape sequences for string literals
The following table lists all valid escape sequences for representing non-alphanumeric characters in string literals. Any sequence not in this table produces an error.
Escape Sequence
Description
\a
Bell
\b
Backspace
\f
Formfeed
\n
Newline
\r
Carriage Return
\t
Tab
\v
Vertical Tab
\\
Backslash (\)
\?
Question Mark (?)
\"
Double Quote (")
\'
Single Quote (')
\\`
Backtick (\`)
\ooo
Octal escape, with exactly 3 digits (in the range 0–7). Decodes to a single Unicode character (in string literals) or byte (in bytes literals).
\xhhor\Xhh
Hex escape, with exactly 2 hex digits (0–9 or A–F or a–f). Decodes to a single Unicode character (in string literals) or byte (in bytes literals). Examples:
'\x41'=='A'
'\x41B'is'AB'
'\x4'is an error
\uhhhh
Unicode escape, with lowercase 'u' and exactly 4 hex digits. Valid only in string literals or identifiers.Note that the range D800-DFFF is not allowed, as these are surrogate unicode values.
\Uhhhhhhhh
Unicode escape, with uppercase 'U' and exactly 8 hex digits. Valid only in string literals or identifiers.The range D800-DFFF is not allowed, as these values are surrogate unicode values. Also, values greater than 10FFFF are not allowed.
Date literals
To use literal date and time values in a calculated field, you can precede the value with the appropriate marker:
Literal
Canonical date format
Sample usage
Date
YYYY-[M]M-[D]D
DATE '2021-4-1'
Date and time
YYYY-[M]M-[D]D [[H]H:[M]M:[S]S]
DATETIME '2021-5-29 23:59:59'
Numeric literals
Enter numeric literals using unquoted integer or floating point values. For example:
Literal
Examples
Sample usage
Integer
1, -1, 0
2 + 2
CASE WHENCost> 100 THEN...
Floating point
1.23, -1.2345
SQRT(3.14)
FLOOR(-42.123)
Boolean literals
Use the literal valuestrueandfalsewhen evaluating Boolean expressions. For example:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Literals\n\nA literal represents a constant value of a built-in data type. Some, but not all, data types can be expressed as literals.\n\nString literals\n---------------\n\nString literals must be *quoted* , either with single ( `'` ) or double ( `\"` ) quotation marks.\n\n**Quoted literals:**\n\n### Escape sequences for string literals\n\nThe following table lists all valid escape sequences for representing non-alphanumeric characters in string literals. Any sequence not in this table produces an error.\n\n### Date literals\n\nTo use literal date and time values in a calculated field, you can precede the value with the appropriate marker:\n\nNumeric literals\n----------------\n\nEnter numeric literals using unquoted integer or floating point values. For example:\n\nBoolean literals\n----------------\n\nUse the literal values `true` and `false` when evaluating Boolean expressions. For example: \n\n IF( \u003cvar translate=\"no\"\u003eBoolean field\u003c/var\u003e = true, \"yes\",\"no\")\n\n IF( \u003cvar translate=\"no\"\u003eBoolean field\u003c/var\u003e = false, \"no\",\"yes\")\n\n**Note:** while the previous is syntactically correct, you can simplify this by referencing the boolean field's value directly: \n\n IF( \u003cvar translate=\"no\"\u003eBoolean field\u003c/var\u003e, \"yes\",\"no\")\n\n IF(not \u003cvar translate=\"no\"\u003eBoolean field\u003c/var\u003e, \"yes\",\"no\")"]]