The following constants are available for your convenience in writing expressions.
Infinity
Function bundle: Core
Represents a value greater than any other number. - may also be used as a value smaller than any number.
Example
Calculates the maximum of four field values
var values = [ $feature.field1, $feature.field2, $feature.field3, $feature.field4 ];
var maxValue = -Infinity;
for(var i in values){
maxValue = IIF(values[i] > maxValue, values[i], maxValue);
}
return maxValue;PI
Function bundle: Core
The value of a circle's circumference divided by its diameter, approximately 3.14159.
Example
Returns the area of a circle feature
var r = $feature.radius;
PI * r * r;TextFormatting.BackwardSlash
Function bundle: Core
Inserts a backslash character \ into the text.
Example
Returns '\\serverName\foo\bar'
TextFormatting.BackwardSlash + TextFormatting.BackwardSlash + $feature.FILE_PATHTextFormatting.DoubleQuote
Function bundle: Core
Inserts a double quote character " into the text.
Example
Returns 'Nicholas "Nick" Anderson'
$feature.NAME + " " + TextFormatting.DoubleQuote + $feature.ALIAS + TextFormatting.DoubleQuote + " " + $feature.SURNAMETextFormatting.ForwardSlash
Function bundle: Core
Inserts a forward slash character / into the text.
Example
Returns '151/low'
$feature.POP_DENSITY + TextFormatting.ForwardSlash + $feature.CLASSTextFormatting.NewLine
Function bundle: Core
Inserts a new line, or line break, into the text. Multi-line labels are NOT supported in the ArcGIS API 3.x for JavaScript nor in the ArcGIS Online Map Viewer Classic.
Example
Returns "T2N
R1W"
"T" + $feature.TOWNSHIP + TextFormatting.NewLine + "R" + $feature.RANGETextFormatting.SingleQuote
Function bundle: Core
Inserts a single quote character ' into the text.
Example
Returns "Nicholas 'Nick' Anderson"
$feature.NAME + " " + TextFormatting.SingleQuote + $feature.ALIAS + TextFormatting.SingleQuote + " " + $feature.SURNAME