Constants

The following constants are available for your convenience in writing expressions.


Infinity

Function bundle: Core

Represents a value greater than any other number. -Infinity may also be used as a value smaller than any number.

Example

Calculates the maximum of four field values

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
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

Use dark colors for code blocksCopy
1
2
var r = $feature.radius;
PI * r * r;

TextFormatting.BackwardSlash

Function bundle: Core

Inserts a backslash character \ into the text.

Example

Returns '\\serverName\foo\bar'

Use dark colors for code blocksCopy
1
TextFormatting.BackwardSlash + TextFormatting.BackwardSlash + $feature.FILE_PATH

TextFormatting.DoubleQuote

Function bundle: Core

Inserts a double quote character " into the text.

Example

Returns 'Nicholas "Nick" Anderson'

Use dark colors for code blocksCopy
1
$feature.NAME + " " + TextFormatting.DoubleQuote + $feature.ALIAS + TextFormatting.DoubleQuote + " " + $feature.SURNAME

TextFormatting.ForwardSlash

Function bundle: Core

Inserts a forward slash character / into the text.

Example

Returns '151/low'

Use dark colors for code blocksCopy
1
$feature.POP_DENSITY + TextFormatting.ForwardSlash + $feature.CLASS

TextFormatting.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.

Example

Returns "T2N R1W"

Use dark colors for code blocksCopy
1
"T" + $feature.TOWNSHIP + TextFormatting.NewLine + "R" + $feature.RANGE

TextFormatting.SingleQuote

Function bundle: Core

Inserts a single quote character ' into the text.

Example

Returns "Nicholas 'Nick' Anderson"

Use dark colors for code blocksCopy
1
$feature.NAME + " " + TextFormatting.SingleQuote + $feature.ALIAS + TextFormatting.SingleQuote + " " + $feature.SURNAME

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.